From e818f8c603d1998c345ed68a02a599cbb56ad204 Mon Sep 17 00:00:00 2001 From: Erzhan-Temir Mamyrov Date: Fri, 16 Jun 2023 17:12:12 +0200 Subject: [PATCH] test(table): select all checkbox state on initial render --- .../components/Table/StatefulTable.test.jsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/react/src/components/Table/StatefulTable.test.jsx b/packages/react/src/components/Table/StatefulTable.test.jsx index 4d2dfc6ee0..f134ae5be1 100644 --- a/packages/react/src/components/Table/StatefulTable.test.jsx +++ b/packages/react/src/components/Table/StatefulTable.test.jsx @@ -1552,4 +1552,24 @@ describe('stateful table with real reducer', () => { }); }); }); + + it('should set select all checkbox to indeterminate state', () => { + const rows = tableData.slice(0, 5); + const selectedIds = rows.map((row) => row.id); + const selectionThatWouldCauseAnIndeterminateState = selectedIds.slice(1, 5); + render( + + ); + expect(screen.getByLabelText('Select all items')).toHaveProperty('indeterminate', true); + }); });