This repository has been archived by the owner on Jun 29, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
175 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import BankAccountList from '../ui/BankAccountList' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<BankAccountList />', () => { | ||
it('renders correctly for 0 bank accounts', () => { | ||
const wrapper = mount(<BankAccountList bankAccounts={[]} />) | ||
|
||
expect(wrapper.find('div.bank-account-list')).toHaveLength(1) | ||
expect(wrapper.find('div.bank-account-list div.bank-account-item')).toHaveLength(0) | ||
}) | ||
|
||
it('renders correctly for 1+ bank accounts', () => { | ||
const wrapper = mount(<BankAccountList bankAccounts={['bank_account_1', 'bank_account_2']} />) | ||
|
||
expect(wrapper.find('div.bank-account-list')).toHaveLength(1) | ||
expect(wrapper.find('div.bank-account-list button')).toHaveLength(2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Footer from '../ui/Footer' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Footer />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<Footer />) | ||
|
||
expect(wrapper.find('div.footer')).toHaveLength(1) | ||
expect(wrapper.find('div div.logo-container')).toHaveLength(1) | ||
expect(wrapper.find('div div.logo-container p')).toHaveLength(1) | ||
expect(wrapper.find('div div.logo-container a.poa-logo')).toHaveLength(1) | ||
expect(wrapper.find('div div.logo-container div.social-container')).toHaveLength(1) | ||
expect(wrapper.find('div div.logo-container div.social-container a.social-item')).toHaveLength( | ||
3 | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Header from '../ui/Header' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Header />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<Header />) | ||
|
||
expect(wrapper.find('header')).toHaveLength(1) | ||
expect(wrapper.find('header div.logo-container')).toHaveLength(1) | ||
expect(wrapper.find('header div.logo-container a.poa-logo')).toHaveLength(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Loading from '../ui/Loading' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Loading />', () => { | ||
it('renders correctly when show is false', () => { | ||
const wrapper = mount(<Loading />) | ||
|
||
expect(wrapper.find('div.loading-container')).toHaveLength(0) | ||
}) | ||
it('renders correctly when show is true', () => { | ||
const wrapper = mount(<Loading show={true} />) | ||
|
||
expect(wrapper.find('div.loading-container')).toHaveLength(1) | ||
expect(wrapper.find('div.loading-container div.loading-inner')).toHaveLength(1) | ||
expect(wrapper.find('div.loading-container div.loading-inner div.loading-dot')).toHaveLength(6) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Logo from '../ui/Logo' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Logo />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<Logo />) | ||
|
||
expect(wrapper.find('a.poa-logo')).toHaveLength(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import LogoContainer from '../ui/LogoContainer' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<LogoContainer />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<LogoContainer />) | ||
|
||
expect(wrapper.find('div.logo-container')).toHaveLength(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Main from '../ui/Main' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Main />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<Main />) | ||
|
||
expect(wrapper.find('div')).toHaveLength(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import RegisteredAccountsList from '../ui/RegisteredAccountsList' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<RegisteredAccountsList />', () => { | ||
it('renders correctly for 0 accounts', () => { | ||
const wrapper = mount(<RegisteredAccountsList accounts={[]} />) | ||
|
||
expect(wrapper.find('div.registered-accounts-list')).toHaveLength(0) | ||
}) | ||
|
||
it('renders correctly for 1+ accounts', () => { | ||
const wrapper = mount(<RegisteredAccountsList accounts={['account_1', 'account_2']} />) | ||
|
||
expect(wrapper.find('div.registered-accounts-list')).toHaveLength(1) | ||
expect(wrapper.find('div.registered-accounts-list ul')).toHaveLength(1) | ||
expect(wrapper.find('div.registered-accounts-list ul li')).toHaveLength(2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { configure, mount } from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import Title from '../ui/Title' | ||
|
||
configure({ adapter: new Adapter() }) | ||
|
||
describe('<Title />', () => { | ||
it('renders correctly', () => { | ||
const wrapper = mount(<Title />) | ||
|
||
expect(wrapper.find('h1')).toHaveLength(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters