mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 13:37:52 +08:00
e91d25622b
* fix: signatures for tests * fix: remove unused * fix: test cases * fix: test cases
18 lines
599 B
TypeScript
18 lines
599 B
TypeScript
import React from 'react';
|
|
import useSyncState from '../hooks/useSyncState';
|
|
import { render, fireEvent } from '../../../tests/utils';
|
|
|
|
describe('Table', () => {
|
|
it('useSyncState', () => {
|
|
const Test = () => {
|
|
const [getVal, setVal] = useSyncState('light');
|
|
return <span onClick={() => setVal('bamboo')}>{getVal()}</span>;
|
|
};
|
|
|
|
const { container } = render(<Test />);
|
|
expect(container.querySelector('span')?.innerHTML).toBe('light');
|
|
fireEvent.click(container.querySelector('span')!);
|
|
expect(container.querySelector('span')?.innerHTML).toBe('bamboo');
|
|
});
|
|
});
|