Skip to content

Commit

Permalink
Chrome 127 has a bug w/ double selectionchange events, fixed in Chrom…
Browse files Browse the repository at this point in the history
…e Canary / 129
  • Loading branch information
NullVoxPopuli committed Aug 15, 2024
1 parent d300515 commit ce8cdcb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test-app/tests/unit/dom/fill-in-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ if (isFirefox || isChrome) {
clickSteps.push('selectionchange');
}

/**
* Prior to Chrome 129 (canary),
* Chrome 127.x emits an extra selectionchange event sometimes
*
* Delete this once we don't want to test against Chrome 127
*/
if (isChrome) {
clickSteps.push('selectionchange');
}

module('DOM Helper: fillIn', function (hooks) {
if (!hasEmberVersion(2, 4)) {
return;
Expand Down Expand Up @@ -313,12 +323,14 @@ module('DOM Helper: fillIn', function (hooks) {
await setupContext(context);
await fillIn(`#${element.id}`, '');

// For this specific case, Firefox does not emit `selectionchange`.
if (isChrome) {
assert.verifySteps(clickSteps);
// For this specific case, Chrome 127 doesn't emit two selectionchange events
assert.verifySteps([...new Set(clickSteps)]);
} else {
// For this specific case, Firefox does not emit `selectionchange`.
assert.verifySteps(clickSteps.filter((s) => s !== 'selectionchange'));
}

assert.strictEqual(
document.activeElement,
element,
Expand Down

0 comments on commit ce8cdcb

Please sign in to comment.