@wonderflow/react-components
Version:
UI components from Wonderflow's Wanda design system
14 lines (13 loc) • 1.72 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { render } from '@testing-library/react';
import { Select } from './select';
describe('<Select>', () => {
test(' it should render properly', () => {
const { container } = render(_jsxs(Select, { defaultValue: "placeholder", label: "My Label", children: [_jsx("option", { value: "placeholder", hidden: true, disabled: true, children: "Pick an option" }), _jsxs("optgroup", { label: "Option Group One", children: [_jsx("option", { value: "1", children: "This is a very long option selected" }), _jsx("option", { value: "2", children: "Option 2" })] }), _jsxs("optgroup", { label: "Option Group Two", children: [_jsx("option", { value: "3", children: "Option 1" }), _jsx("option", { value: "4", children: "Option 2" }), _jsx("option", { value: "5", children: "Option 3" })] })] }));
expect(container).not.toBeNull();
});
test(' it should render properly with props', () => {
const { container } = render(_jsxs(Select, { defaultValue: "placeholder", label: "My Label", message: "test", dimension: "small", disabled: true, children: [_jsx("option", { value: "placeholder", hidden: true, disabled: true, children: "Pick an option" }), _jsxs("optgroup", { label: "Option Group One", children: [_jsx("option", { value: "1", children: "This is a very long option selected" }), _jsx("option", { value: "2", children: "Option 2" })] }), _jsxs("optgroup", { label: "Option Group Two", children: [_jsx("option", { value: "3", children: "Option 1" }), _jsx("option", { value: "4", children: "Option 2" }), _jsx("option", { value: "5", children: "Option 3" })] })] }));
expect(container).not.toBeNull();
});
});