Skip to content

Commit

Permalink
test: remove obsolete waitForEvent() method (#3210)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: waitForEvent() method was removed in favor of using EventSpy class
  • Loading branch information
jeripeierSBB authored Nov 18, 2024
1 parent 39fa565 commit dba0322
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/elements/core/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export * from './testing/event-spy.js';
export * from './testing/mocha-extensions.js';
export * from './testing/scroll.js';
export * from './testing/wait-for-condition.js';
export * from './testing/wait-for-event.js';
export * from './testing/wait-for-image-ready.js';
export * from './testing/wait-for-render.js';
19 changes: 0 additions & 19 deletions src/elements/core/testing/wait-for-event.ts

This file was deleted.

6 changes: 4 additions & 2 deletions src/elements/navigation/navigation/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { html } from 'lit/static-html.js';
import type { SbbButtonElement } from '../../button.js';
import { pageScrollDisabled } from '../../core/dom.js';
import { fixture, tabKey } from '../../core/testing/private.js';
import { EventSpy, waitForCondition, waitForEvent, waitForLitRender } from '../../core/testing.js';
import { EventSpy, waitForCondition, waitForLitRender } from '../../core/testing.js';
import type { SbbNavigationButtonElement } from '../navigation-button.js';
import type { SbbNavigationSectionElement } from '../navigation-section.js';

Expand Down Expand Up @@ -524,8 +524,10 @@ describe(`sbb-navigation`, () => {
});

it('should re-enable scrolling when removed from the DOM', async () => {
const didOpenEventSpy = new EventSpy(SbbNavigationElement.events.didOpen);

element.open();
await waitForEvent(element, SbbNavigationElement.events.didOpen);
await didOpenEventSpy.calledOnce();

expect(pageScrollDisabled()).to.be.true;

Expand Down

0 comments on commit dba0322

Please sign in to comment.