Skip to content

Commit ef4c740

Browse files
committed
Auto merge of #2124 - Turbo87:keyboard, r=locks
tests/search: Use `ember-keyboard` test helpers These were made for testing, while the previous helpers worked, but had a different purpose. The advantage of the new helpers is that they are based on `@ember/test-helpers` and are calling `settled()` at the end to wait for any effects from the user interaction to settle. r? @locks
2 parents 5cc7fb4 + 9a9426f commit ef4c740

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/acceptance/search-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { module, test } from 'qunit';
22
import { setupApplicationTest } from 'ember-qunit';
33
import { fillIn, currentURL, triggerEvent, visit, blur } from '@ember/test-helpers';
44
import a11yAudit from 'ember-a11y-testing/test-support/audit';
5-
import { triggerKeyDown, triggerKeyPress } from 'ember-keyboard';
5+
import { keyDown, keyPress } from 'ember-keyboard/test-support/test-helpers';
66
import axeConfig from '../axe-config';
77
import { title } from '../helpers/dom';
88
import setupMirage from '../helpers/setup-mirage';
@@ -82,19 +82,19 @@ module('Acceptance | search', function(hooks) {
8282
await visit('/');
8383

8484
await blur('[data-test-search-input]');
85-
await triggerKeyPress('KeyA');
85+
await keyPress('KeyA');
8686
assert.dom('[data-test-search-input]').isNotFocused();
8787

8888
await blur('[data-test-search-input]');
89-
await triggerKeyPress('KeyS');
89+
await keyPress('KeyS');
9090
assert.dom('[data-test-search-input]').isFocused();
9191

9292
await blur('[data-test-search-input]');
93-
await triggerKeyDown('KeyS');
93+
await keyDown('KeyS');
9494
assert.dom('[data-test-search-input]').isFocused();
9595

9696
await blur('[data-test-search-input]');
97-
await triggerKeyDown('shift+KeyS');
97+
await keyDown('shift+KeyS');
9898
assert.dom('[data-test-search-input]').isFocused();
9999
});
100100

0 commit comments

Comments
 (0)