Skip to content

Commit ce8cdcb

Browse files
committed
Chrome 127 has a bug w/ double selectionchange events, fixed in Chrome Canary / 129
1 parent d300515 commit ce8cdcb

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ if (isFirefox || isChrome) {
1616
clickSteps.push('selectionchange');
1717
}
1818

19+
/**
20+
* Prior to Chrome 129 (canary),
21+
* Chrome 127.x emits an extra selectionchange event sometimes
22+
*
23+
* Delete this once we don't want to test against Chrome 127
24+
*/
25+
if (isChrome) {
26+
clickSteps.push('selectionchange');
27+
}
28+
1929
module('DOM Helper: fillIn', function (hooks) {
2030
if (!hasEmberVersion(2, 4)) {
2131
return;
@@ -313,12 +323,14 @@ module('DOM Helper: fillIn', function (hooks) {
313323
await setupContext(context);
314324
await fillIn(`#${element.id}`, '');
315325

316-
// For this specific case, Firefox does not emit `selectionchange`.
317326
if (isChrome) {
318-
assert.verifySteps(clickSteps);
327+
// For this specific case, Chrome 127 doesn't emit two selectionchange events
328+
assert.verifySteps([...new Set(clickSteps)]);
319329
} else {
330+
// For this specific case, Firefox does not emit `selectionchange`.
320331
assert.verifySteps(clickSteps.filter((s) => s !== 'selectionchange'));
321332
}
333+
322334
assert.strictEqual(
323335
document.activeElement,
324336
element,

0 commit comments

Comments
 (0)