"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 SelectGroup_1 = require("../SelectGroup");
const SelectContent = [
    { label: '--Select--', value: '' },
    { label: 'Option-1', value: 'option1' },
    { label: 'Option-2', value: 'option2' },
    { label: 'Option-3', value: 'option3' },
    { label: 'Option-4', value: 'option4' },
];
describe('SelectGroup component', () => {
    it('renders options', async () => {
        const setValue = vitest_1.vi.fn();
        (0, react_2.render)(react_1.default.createElement(SelectGroup_1.SelectGroup, { id: "test-select", options: SelectContent, value: "", layout: "inline", setValue: setValue }));
        expect(await react_2.screen.queryAllByRole('option')).toHaveLength(5);
    });
    it('is selectable', async () => {
        const setValue = vitest_1.vi.fn();
        (0, react_2.render)(react_1.default.createElement(SelectGroup_1.SelectGroup, { id: "test-select", options: SelectContent, value: "", setValue: setValue, layout: "inline" }));
        const select = await react_2.screen.getByRole('combobox');
        react_2.fireEvent.change(select, { target: { value: 'option4' } });
        expect(setValue).toHaveBeenCalledWith('option4');
    });
});
