(mode: any)
| 4 | import { render } from '@testing-library/react'; |
| 5 | |
| 6 | export default function throwOptionValue(mode: any) { |
| 7 | it('warn option value type', () => { |
| 8 | resetWarned(); |
| 9 | |
| 10 | const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => null); |
| 11 | |
| 12 | render( |
| 13 | <Select mode={mode} open> |
| 14 | <Option value={1}>1</Option> |
| 15 | </Select>, |
| 16 | ); |
| 17 | |
| 18 | expect(errorSpy).toHaveBeenCalledWith( |
| 19 | 'Warning: `value` of Option should not use number type when `mode` is `tags` or `combobox`.', |
| 20 | ); |
| 21 | |
| 22 | errorSpy.mockRestore(); |
| 23 | }); |
| 24 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…