-
Notifications
You must be signed in to change notification settings - Fork 64
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: Use a different way to update window object in tests #2095
Conversation
cypress/support/commands.js
Outdated
}, | ||
}, | ||
getApp: () => 'inventory', | ||
window.chrome = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would mocking all this with the useChrome
override not make the use of the window
object obsolete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, it seems this property modification is already obsolete. I will try now to remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in the next commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I didn't remove the window.insights mock because some parts of the code (but not Inventory's) still refers to window.insights.chrome object for some reason.
(uncaught exception)Error: Objects are not valid as a React child (found: TypeError: Cannot read properties of undefined (reading 'chrome')). If you meant to render a collection of children, use an array instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be remnants of the chrome older version which embedded the chrome into the window heavily. Maybe if we find what packages are still using that old version and update them, we can remove this final bit as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can. But not sure it will contribute much to the issue with the tests I am trying to solve currently. I will keep you note in mind and fix in a separate PR.
Also merging this. Looks like at least 2 people took a look and there is almost no way to verify this PR, so let's see if it heals CI on master.
/retest |
07609f8
to
7a3136c
Compare
🎉 This PR is included in version 1.59.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an attempt to fix the coverage random error happening on Travis CI while executing component tests.