"use strict";

var _react = _interopRequireDefault(require("react"));
var _testUtilities = require("testUtilities");
var _mastercard = _interopRequireDefault(require("./mastercard"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
describe("MasterCardPill component", function () {
  test("should render default component", function () {
    (0, _testUtilities.renderWithProviders)(/*#__PURE__*/_react["default"].createElement(_mastercard["default"], null));
    expect(_testUtilities.screen.queryByTestId("mastercard")).toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("mastercard-left-pill")).toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("mastercard-right-pill")).toBeInTheDocument();
  });
  test("should render component with custom test id", function () {
    (0, _testUtilities.renderWithProviders)(/*#__PURE__*/_react["default"].createElement(_mastercard["default"], {
      "data-testid": "custom-mastercard"
    }));
    expect(_testUtilities.screen.queryByTestId("mastercard")).not.toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("mastercard-left-pill")).not.toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("mastercard-right-pill")).not.toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("custom-mastercard")).toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("custom-mastercard-left-pill")).toBeInTheDocument();
    expect(_testUtilities.screen.queryByTestId("custom-mastercard-right-pill")).toBeInTheDocument();
  });
  test("should render clickable component", function () {
    var mockedOnClick = jest.fn();
    (0, _testUtilities.renderWithProviders)(/*#__PURE__*/_react["default"].createElement(_mastercard["default"], {
      onClick: mockedOnClick
    }));
    expect(_testUtilities.screen.queryByTestId("mastercard")).toHaveStyleRule("cursor", "pointer");
  });
});