Skip to content

Commit 1adc67f

Browse files
committed
refactor(select): Use SlotController and code clean-ups
1 parent a48f730 commit 1adc67f

File tree

2 files changed

+213
-185
lines changed

2 files changed

+213
-185
lines changed

src/components/select/select.spec.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import {
2-
aTimeout,
3-
elementUpdated,
4-
expect,
5-
fixture,
6-
html,
7-
} from '@open-wc/testing';
8-
import { spy } from 'sinon';
1+
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
2+
import { spy, useFakeTimers } from 'sinon';
93

104
import {
115
altKey,
@@ -875,16 +869,20 @@ describe('Select', () => {
875869
});
876870

877871
it('resumes search after default timeout', async () => {
872+
const clock = useFakeTimers({ now: 0, toFake: ['Date'] });
873+
878874
simulateKeyboard(select, 'null'.split(''));
879875
await elementUpdated(select);
880876

881877
expect(select.selectedItem).to.be.null;
882878

883-
await aTimeout(501);
879+
await clock.tickAsync(501);
880+
884881
simulateKeyboard(select, 'impl'.split(''));
885882
await elementUpdated(select);
886883

887884
expect(select.selectedItem?.value).to.equal('implementation');
885+
clock.restore();
888886
});
889887

890888
it('activates the correct item when searching with character keys (open state)', async () => {

0 commit comments

Comments
 (0)