mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
fix test coverage
This commit is contained in:
parent
8d2dee6554
commit
ba33fc52a4
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { render } from '@testing-library/react'
|
||||
import { render, fireEvent } from '@testing-library/react'
|
||||
import { toDataUrl } from 'ethereum-blockies'
|
||||
import Account from './Account'
|
||||
import { User } from '../../context'
|
||||
@ -18,12 +18,13 @@ describe('Account', () => {
|
||||
})
|
||||
|
||||
it('outputs empty state without account', () => {
|
||||
const { container } = render(
|
||||
const { container, getByText } = render(
|
||||
<User.Provider value={{ ...userMockConnected, account: '' }}>
|
||||
<Account />
|
||||
</User.Provider>
|
||||
)
|
||||
expect(container.firstChild).toHaveTextContent('No account selected')
|
||||
fireEvent.click(getByText('Unlock Account'))
|
||||
})
|
||||
|
||||
it('outputs blockie img', () => {
|
||||
@ -41,4 +42,20 @@ describe('Account', () => {
|
||||
blockies
|
||||
)
|
||||
})
|
||||
|
||||
it('Account info can be toggled', () => {
|
||||
const { container, getByText } = render(
|
||||
<User.Provider
|
||||
value={{
|
||||
...userMockConnected,
|
||||
isBurner: true,
|
||||
account: '0xxxxxxxxxxxxxxx'
|
||||
}}
|
||||
>
|
||||
<Account />
|
||||
</User.Provider>
|
||||
)
|
||||
expect(container.firstChild).toBeInTheDocument()
|
||||
fireEvent.click(getByText('Burner Wallet'))
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user