Skip to content

Commit

Permalink
fix(selection-panel): fix typo (#2347)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga authored Jan 17, 2024
1 parent 276e578 commit 074b63b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/selection-panel/selection-panel.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,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');

Expand Down
2 changes: 1 addition & 1 deletion src/components/selection-panel/selection-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class SbbSelectionPanelElement extends LitElement {
private _updateSelectionPanel(): void {
this._checked = this._input?.checked;
this._state =
this.forceOpen || (this._namedSlots.slots.has['content'] && this._checked)
this.forceOpen || (this._namedSlots.slots.has('content') && this._checked)
? 'opened'
: 'closed';
this._disabled = this._input?.disabled;
Expand Down

0 comments on commit 074b63b

Please sign in to comment.