"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const react_1 = __importDefault(require("react"));
const react_2 = require("@testing-library/react");
const Button_1 = require("../Button");
describe('Button component', () => {
    it('is clickable', () => {
        const onClick = vitest_1.vi.fn();
        (0, react_2.render)(react_1.default.createElement(Button_1.Button, { label: "Primary", primary: true, onClick: onClick }));
        expect(onClick).not.toBeCalled();
        react_2.fireEvent.click(react_2.screen.getByText(/Primary/));
        expect(onClick).toBeCalled();
    });
    it('is not clickable while disabled', () => {
        const onClick = vitest_1.vi.fn();
        (0, react_2.render)(react_1.default.createElement(Button_1.Button, { label: "Primary", primary: true, onClick: onClick, disabled: true }));
        expect(onClick).not.toBeCalled();
        react_2.fireEvent.click(react_2.screen.getByText(/Primary/));
        expect(onClick).not.toBeCalled();
    });
});
