Skip to content

Commit 4a62d25

Browse files
committed
test(fillIn): account for selectionchange in Firefox
1 parent 9d8843d commit 4a62d25

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/unit/dom/fill-in-test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import {
66
_registerHook,
77
} from '@ember/test-helpers';
88
import { buildInstrumentedElement, insertElement } from '../../helpers/events';
9-
import { isIE11 } from '../../helpers/browser-detect';
9+
import { isIE11, isFirefox } from '../../helpers/browser-detect';
1010
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
1111

1212
let clickSteps = ['focus', 'focusin', 'input', 'change'];
1313

1414
if (isIE11) {
1515
clickSteps = ['focusin', 'input', 'change', 'focus'];
16+
} else if (isFirefox) {
17+
clickSteps.push('selectionchange');
1618
}
1719

1820
module('DOM Helper: fillIn', function (hooks) {
@@ -226,7 +228,8 @@ module('DOM Helper: fillIn', function (hooks) {
226228
await setupContext(context);
227229
await fillIn(element, 'foo');
228230

229-
assert.verifySteps(clickSteps);
231+
// For this specific case, Firefox does not emit `selectionchange`.
232+
assert.verifySteps(clickSteps.filter((s) => s !== 'selectionchange'));
230233
assert.strictEqual(
231234
document.activeElement,
232235
element,
@@ -255,7 +258,8 @@ module('DOM Helper: fillIn', function (hooks) {
255258
await setupContext(context);
256259
await fillIn(`#${element.id}`, '');
257260

258-
assert.verifySteps(clickSteps);
261+
// For this specific case, Firefox does not emit `selectionchange`.
262+
assert.verifySteps(clickSteps.filter((s) => s !== 'selectionchange'));
259263
assert.strictEqual(
260264
document.activeElement,
261265
element,

0 commit comments

Comments
 (0)