ant-design/components/table/__tests__/Table.IE.test.tsx
二货爱吃白萝卜 bef9539e22
feat: Table support scrollTo reference (#45245)
* feat: add ref

* feat: table support reference

* chore: rename

* chore: proxy

* test: add test case

* chore: fix lint

* docs: update desc

* docs: update desc

* docs: update desc

* chore: clean up

* chore: fix lint
2023-10-11 13:55:20 +08:00

23 lines
585 B
TypeScript

import React from 'react';
import type { TableRef } from '..';
import Table from '..';
import { render } from '../../../tests/utils';
describe('Table.IE', () => {
beforeAll(() => {
window.Proxy = undefined as any;
global.Proxy = undefined as any;
});
it('support reference', () => {
const tblRef = React.createRef<TableRef>();
const { container } = render(<Table ref={tblRef} />);
const wrapDom = container.querySelector('.ant-table-wrapper')!;
expect(tblRef.current).toBe(wrapDom);
expect(tblRef.current?.nativeElement).toBe(wrapDom);
});
});