-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use clock & tick instead of waituntil #398
Conversation
Need to check again, it worked locally, somehow the clock/tick doesn't seem to work well here. |
cy.clock() | ||
topMenuItems.connectButton().click() | ||
landingPage.accountsLoader().should('contain', 'Loading accounts') | ||
cy.tick(500) |
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.
As I understood from the documentation, it's a method to mock the time. I didn't find any setInterval in our implementation. Isn't it just pending Promise, or am I mistaken?
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.
Nope there's a settimeout to go around a bug
Multix/packages/ui/src/contexts/AccountsContext.tsx
Lines 135 to 138 in 2a1f23b
// delay the request by 500ms | |
// race condition see https://github.com/polkadot-js/extension/issues/938 | |
setTimeout(() => { | |
getaccountList(chainInfo.isEthereum) |
So effectively, when the user clicks on the Connect button, the request is fired 500ms after. But because it's in useEffect etc. it may be a lil more. tick(600)
or more failed sometimes for me still.
I'm giving up. The time i spent isn't worth it imho opened #403 to do a small refactor and that's it |
Small refactor to prevent using
waitUntil
when we know there's a setTimeout.