Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Oct 17, 2023
1 parent ba4733f commit 8fe942f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
17 changes: 0 additions & 17 deletions src/components/sbb-accordion/sbb-accordion.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ describe('sbb-accordion', () => {

it('should set accordion context on expansion panel when removing and adding expansion-panels', async () => {
let panels: SbbExpansionPanel[];
await waitForLitRender(element);

element.querySelector('sbb-expansion-panel').remove();
await waitForLitRender(element);
Expand Down Expand Up @@ -120,28 +119,22 @@ describe('sbb-accordion', () => {
}

headerTwo.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 1);
expect(willOpenEventSpy.count).to.be.equal(1);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(false);
expect(panelTwo.expanded).to.be.equal(true);
expect(panelThree.expanded).to.be.equal(false);

headerOne.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 2);
expect(willOpenEventSpy.count).to.be.equal(2);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(true);
expect(panelTwo.expanded).to.be.equal(false);
expect(panelThree.expanded).to.be.equal(false);

headerThree.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 3);
expect(willOpenEventSpy.count).to.be.equal(3);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(false);
expect(panelTwo.expanded).to.be.equal(false);
expect(panelThree.expanded).to.be.equal(true);
Expand All @@ -163,28 +156,22 @@ describe('sbb-accordion', () => {
}

headerTwo.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 1);
expect(willOpenEventSpy.count).to.be.equal(1);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(false);
expect(panelTwo.expanded).to.be.equal(true);
expect(panelThree.expanded).to.be.equal(false);

headerOne.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 2);
expect(willOpenEventSpy.count).to.be.equal(2);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(true);
expect(panelTwo.expanded).to.be.equal(true);
expect(panelThree.expanded).to.be.equal(false);

headerThree.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 3);
expect(willOpenEventSpy.count).to.be.equal(3);
await waitForLitRender(element);
expect(panelOne.expanded).to.be.equal(true);
expect(panelTwo.expanded).to.be.equal(true);
expect(panelThree.expanded).to.be.equal(true);
Expand All @@ -206,17 +193,13 @@ describe('sbb-accordion', () => {
const willOpenEventSpy = new EventSpy(sbbExpansionPanelEvents.willOpen);

headerTwo.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 1);
expect(willOpenEventSpy.count).to.be.equal(1);
await waitForLitRender(element);
expect(panelTwo.expanded).to.be.equal(true);

headerThree.click();
await waitForLitRender(element);
await waitForCondition(() => willOpenEventSpy.events.length === 2);
expect(willOpenEventSpy.count).to.be.equal(2);
await waitForLitRender(element);
expect(panelThree.expanded).to.be.equal(true);

element.multi = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CSSResult, html, LitElement, nothing, TemplateResult } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { SbbExpansionPanel } from '../sbb-expansion-panel';
import Style from './sbb-expansion-panel-header.scss?lit&inline';
import '../sbb-icon';

/**
* @slot icon - Slot used to render the panel header icon.
Expand Down

0 comments on commit 8fe942f

Please sign in to comment.