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
stub extension search in UI test #12714
Conversation
Thanks for making a pull request to jupyterlab! |
@@ -81,6 +86,8 @@ test.describe('Extension Manager', () => { | |||
expect( | |||
await page.screenshot({ clip: { y: 31, x: 0, width: 283, height: 600 } }) | |||
).toMatchSnapshot('extensions_search.png'); | |||
|
|||
await unstubExtensionsSearch(page); |
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, it turns out page.route
doesn't remove the route stub after a test completes, so it's required to call page.unroute
manually after each test. If anybody knows an alternative to this (that doesn't make it so easy for devs to accidentally share stubs across tests), please LMK!
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.
@dlqqq how did you come to that conclusion? The .route
is linked to the page object that is unique for each test (except when using some specific describe block). So I'm a bit surprised it needs to be undone explicitly.
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 noticed this when adding page.route
caused the other snapshot tests to fail. I'm also surprised, since I also assumed that the page object is unique per test. This probably warrants further investigation since ideally page routings shouldn't get shared across tests.
Thanks a lot for working on this @dlqqq |
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.
Thanks!
References
Fixes #12340. Lays groundwork for further stubbing (if necessary) in the extension manager UI tests.
Code changes
Adds stub for extension search. To stub the GH avatars in the search results, I decided to use the Jupyter logo since the avatars in the original snapshot were those of QuantStack and another GitHub user (deathbeds@). Wanted to avoid copyright/trademark/legal/privacy issues.
Open to feedback regarding the stub data I've used. Now is the time to change it if we want to.
User-facing changes
None.
Backwards-incompatible changes
None known.