"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.datasetType_available = void 0;
const vitest_1 = require("vitest");
const react_1 = __importDefault(require("react"));
const react_2 = require("@testing-library/react");
const RadioGroup_1 = require("../RadioGroup");
require("@testing-library/jest-dom/extend-expect");
exports.datasetType_available = [
    { label: 'All Public', value: 'All Public' },
    { label: 'Following', value: 'Following' },
    { label: 'My Datasets', value: 'My Datasets' },
    { label: 'My Bookmarks', value: 'My Bookmarks' },
];
describe('RadioGroup component', () => {
    it('has selectable options', async () => {
        const setSelected = vitest_1.vi.fn();
        (0, react_2.render)(react_1.default.createElement(RadioGroup_1.RadioGroup, { setSelected: setSelected, selected: 'All Public', name: "name", radioArr: exports.datasetType_available, layout: "row" }));
        // Check an option is rendered
        expect(await react_2.screen.getByText(/Following/)).toBeInTheDocument();
        const followingRadio = react_2.screen.getByText('Following');
        react_2.fireEvent.click(followingRadio);
        expect(setSelected).toHaveBeenCalledWith('Following');
    });
});
