Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

feat: [wallet connection] update tests#62

Merged
kristiehuang merged 12 commits intowallet-connect-flowfrom
wcf/tests
Aug 4, 2022
Merged

feat: [wallet connection] update tests#62
kristiehuang merged 12 commits intowallet-connect-flowfrom
wcf/tests

Conversation

@kristiehuang
Copy link
Contributor

@kristiehuang kristiehuang commented Jul 21, 2022

updating e2e wallet connection tests

@vercel
Copy link

vercel bot commented Jul 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
widgets ✅ Ready (Inspect) Visit Preview Aug 4, 2022 at 5:53PM (UTC)

@kristiehuang kristiehuang changed the base branch from wallet-connect-flow to fix/json-change July 21, 2022 23:24
@vercel vercel bot temporarily deployed to Preview July 21, 2022 23:25 Inactive
@kristiehuang kristiehuang changed the base branch from fix/json-change to wallet-connect-flow July 27, 2022 19:37
@vercel vercel bot temporarily deployed to Preview July 27, 2022 19:47 Inactive
@vercel vercel bot temporarily deployed to Preview July 28, 2022 15:07 Inactive
expect(wallet.hidden).toBeTruthy()
await waitFor(() => expect(toolbar.textContent).not.toBe('Connecting…'))
account = await component.findByTestId('account')
toolbar = (await component.findAllByTestId('toolbar'))[1]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one thing I am very confused about is why it finds multiple elements here with testId 'toolbar' -- one that says "Connect to wallet to swap" and a second one that says "Enter an amount"

@kristiehuang kristiehuang marked this pull request as ready for review July 28, 2022 15:09
@vercel vercel bot temporarily deployed to Preview July 28, 2022 15:10 Inactive
@vercel vercel bot temporarily deployed to Preview August 1, 2022 20:55 Inactive
act(() => component.rerender(<SwapWidget tokenList={tokens} jsonRpcUrlMap={{ 1: [hardhat.url] }} />))
expect(wallet.hidden).toBeTruthy()
describe('with integrator jsonRpcUrlMap', () => {
it('prompts for wallet connection in the Wallet and Toolbar', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

these two cases should be tested separately

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 think it makes more sense to test at once? - it's one test case (passing in jsonRpcUrlMap={{ 1: [hardhat.url] }}), and we're just checking that the textContent in the wallet chip + toolbar appear as expected

Copy link
Contributor

Choose a reason for hiding this comment

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

when tests fail it's better to know exactly what failed, instead of needing to go fiddle with the test and double check the logs to see which thing that was being tested failed

@vercel vercel bot temporarily deployed to Preview August 2, 2022 22:34 Inactive
@kristiehuang kristiehuang requested a review from JFrankfurt August 2, 2022 22:37
@vercel vercel bot temporarily deployed to Preview August 4, 2022 16:57 Inactive
@kristiehuang kristiehuang requested a review from zzmp August 4, 2022 16:57
@vercel vercel bot temporarily deployed to Preview August 4, 2022 17:04 Inactive
@vercel vercel bot temporarily deployed to Preview August 4, 2022 17:08 Inactive
@vercel vercel bot temporarily deployed to Preview August 4, 2022 17:10 Inactive
@vercel vercel bot temporarily deployed to Preview August 4, 2022 17:12 Inactive
@vercel vercel bot temporarily deployed to Preview August 4, 2022 17:50 Inactive
@kristiehuang kristiehuang merged commit 191575e into wallet-connect-flow Aug 4, 2022
@kristiehuang kristiehuang deleted the wcf/tests branch August 4, 2022 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants