Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan committed Sep 28, 2024
1 parent edcd865 commit 8c56884
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/Virtual.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,20 @@ describe('Table.Virtual', () => {

describe('expandable', () => {
it('basic', () => {
const { container } = getTable({
expandable: {
expandedRowKeys: ['name0', 'name3'],
expandedRowRender: record => record.name,
expandedRowClassName: 'bamboo',
},
(['bamboo', () => 'bamboo'] as const).forEach(cls => {
const { container } = getTable({
expandable: {
expandedRowKeys: ['name0', 'name3'],
expandedRowRender: record => record.name,
expandedRowClassName: cls,
},
});
const expandedCells = container.querySelectorAll('.rc-table-expanded-row-cell');
expect(expandedCells).toHaveLength(2);
expect(expandedCells[0].textContent).toBe('name0');
expect(expandedCells[1].textContent).toBe('name3');
expect(container.querySelector('.rc-table-expanded-row')).toHaveClass('bamboo');
});
const expandedCells = container.querySelectorAll('.rc-table-expanded-row-cell');
expect(expandedCells).toHaveLength(2);
expect(expandedCells[0].textContent).toBe('name0');
expect(expandedCells[1].textContent).toBe('name3');
expect(container.querySelector<HTMLElement>('.rc-table-expanded-row')).toHaveClass('bamboo');
});

it('fixed', () => {
Expand Down

0 comments on commit 8c56884

Please sign in to comment.