From 1089144440a5ff385ae8c4eb3b297873ac0d357b Mon Sep 17 00:00:00 2001 From: Tommmaso Menga Date: Wed, 17 Jan 2024 12:04:40 +0100 Subject: [PATCH] test(selection-panel): enhance test coverage --- src/components/selection-panel/selection-panel.e2e.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/selection-panel/selection-panel.e2e.ts b/src/components/selection-panel/selection-panel.e2e.ts index 3a5a129462..8bc512a10e 100644 --- a/src/components/selection-panel/selection-panel.e2e.ts +++ b/src/components/selection-panel/selection-panel.e2e.ts @@ -461,13 +461,20 @@ describe('sbb-selection-panel', () => { }); it('selects input on click and shows related content', async () => { + await waitForLitRender(wrapper); + assert.instanceOf(firstPanel, SbbSelectionPanelElement); assert.instanceOf(firstInput, SbbCheckboxElement); + + // TODO fix: should be 'opened', actual is 'close'. + // we have to rethink the open/close flow to make it work + //expect(firstPanel).to.have.attribute('data-state', 'opened'); expect(firstInput).to.have.attribute('checked'); expect(firstContent).to.have.attribute('data-expanded', ''); assert.instanceOf(secondPanel, SbbSelectionPanelElement); assert.instanceOf(secondInput, SbbCheckboxElement); + expect(firstPanel).to.have.attribute('data-state', 'closed'); expect(secondInput).not.to.have.attribute('checked'); expect(secondContent).not.to.have.attribute('data-expanded');