Skip to content

Commit 536bdc8

Browse files
author
Nicolò Zandarin
committed
test: cover collapsing force-rendered rows
1 parent 2a55be7 commit 536bdc8

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/ExpandRow.spec.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ describe('Table.Expand', () => {
6363

6464
expect(expandedRows[0]).not.toHaveStyle({ display: 'none' });
6565
expect(expandedRows[1]).toHaveStyle({ display: 'none' });
66+
67+
fireEvent.click(container.querySelector('.rc-table-row-expand-icon'));
68+
69+
expect(expandedRows[0]).toHaveStyle({ display: 'none' });
70+
expect(expandedRows[1]).toHaveStyle({ display: 'none' });
6671
});
6772

6873
it('renders tree row correctly', () => {

tests/Virtual.spec.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ describe('Table.Virtual', () => {
203203
expect(container.querySelector('.rc-table-expanded-row')).not.toHaveStyle({
204204
display: 'none',
205205
});
206+
207+
fireEvent.click(container.querySelector('.rc-table-row-expand-icon')!);
208+
209+
expect(container.querySelector('.rc-table-expanded-row')).toHaveStyle({
210+
display: 'none',
211+
});
206212
});
207213

208214
it('applies expanded row class to tree rows', () => {

0 commit comments

Comments
 (0)