mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-23 04:19:48 +00:00
Init test case component
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
import Select from '.';
|
||||
|
||||
describe('Select testing snapshot', () => {
|
||||
const options = [
|
||||
{
|
||||
label: 'Option 1',
|
||||
value: 'Value 1',
|
||||
},
|
||||
{
|
||||
label: 'Option 2',
|
||||
value: 'Value 2'
|
||||
}
|
||||
];
|
||||
const value = 'Temp value';
|
||||
const handleOnChange = () => {
|
||||
console.log('On change');
|
||||
}
|
||||
|
||||
const wrapper = renderer.create(
|
||||
<Select
|
||||
options={options}
|
||||
value={value}
|
||||
onChange={handleOnChange}
|
||||
ariaLabel="Sort"
|
||||
/>
|
||||
);
|
||||
|
||||
test('render', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user