MCPcopy Create free account
hub / github.com/react-component/select / throwOptionValue

Function throwOptionValue

tests/shared/throwOptionValue.tsx:6–24  ·  view source on GitHub ↗
(mode: any)

Source from the content-addressed store, hash-verified

4import { render } from '@testing-library/react';
5
6export 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}

Callers 2

Combobox.test.tsxFile · 0.85
Tags.test.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…