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

[NumberField] Fix failing browser tests #317

Merged
merged 6 commits into from
Apr 16, 2024

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Apr 15, 2024

Draft to experiment, these somehow started failing after merge

@atomiks atomiks marked this pull request as draft April 15, 2024 12:36
@atomiks atomiks added the component: number field This is the name of the generic UI component, not the React module! label Apr 15, 2024
Comment on lines +139 to +145
try {
// Avoid non-deterministic errors in testing environments. This error sometimes
// appears:
// "The root document of this element is not valid for pointer lock."
// We need to await it even though it doesn't appear to return a promise in the
// types in order for the `catch` to work.
await ownerDocument(scrubAreaRef.current).body.requestPointerLock();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Types suggest you don't need await, but I think you do for some browsers/envs?... 🫠

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this error also sometimes appeared for document.body.requestPointerLock(), so it doesn't seem related to ownerDocument.

@atomiks atomiks marked this pull request as ready for review April 15, 2024 13:29
@atomiks atomiks force-pushed the fix/number-field-browser-tests branch from 96c2de8 to 5057e0a Compare April 16, 2024 10:51
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Tests do pass now 👍

@atomiks atomiks merged commit 15b00bf into mui:master Apr 16, 2024
16 checks passed
@atomiks atomiks deleted the fix/number-field-browser-tests branch April 16, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: number field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants