From ba33fc52a45f42e0512559fe3048999a3f7128f9 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 15 Jul 2019 16:14:55 +0200 Subject: [PATCH] fix test coverage --- client/src/components/atoms/Account.test.tsx | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/client/src/components/atoms/Account.test.tsx b/client/src/components/atoms/Account.test.tsx index 9e81653..586d9d0 100644 --- a/client/src/components/atoms/Account.test.tsx +++ b/client/src/components/atoms/Account.test.tsx @@ -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( ) 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( + + + + ) + expect(container.firstChild).toBeInTheDocument() + fireEvent.click(getByText('Burner Wallet')) + }) })