Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(fillIn,typeIn): account for selectionchange in Firefox #1195

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

buschtoens
Copy link
Contributor

Tests for fillIn and typeIn are failing in Firefox, because it emits a selectionchange event, unlike Chrome.

This conditionally adds selectionchange to the list of expected events, similar to how Internet Explorer is handled already.

Comment on lines +9 to +10
// Unlike Chrome, Firefox emits `selectionchange` events.
export const isFirefox = navigator.userAgent.indexOf('Firefox') >= 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to do a proper feature detection instead of resorting to user agent parsing, but unfortunately that would have required async code, which is not possible here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do it async, and have tests/test-helper.js call the function before calling start() to kick off the tests...

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

assert.verifySteps(clickSteps);
// For this specific case, Firefox does not emit `selectionchange`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat, why!?

@rwjblue rwjblue merged commit c74acb8 into emberjs:master Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants