feat: [wallet connection] update tests#62
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e2e/connect.test.tsx
Outdated
| expect(wallet.hidden).toBeTruthy() | ||
| await waitFor(() => expect(toolbar.textContent).not.toBe('Connecting…')) | ||
| account = await component.findByTestId('account') | ||
| toolbar = (await component.findAllByTestId('toolbar'))[1] |
There was a problem hiding this comment.
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"
| 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 () => { |
There was a problem hiding this comment.
these two cases should be tested separately
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
updating e2e wallet connection tests