Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Coinify): change error check and include error msg for other errors
- Loading branch information
Philip Welber
authored and
plondon
committed
Sep 21, 2018
1 parent
24dbb23
commit 4e83280
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...kchain-wallet-v4-frontend/src/modals/CoinifyExchangeData/Create/AcceptTerms/index.spec.js
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,45 @@ | ||
import React from 'react' | ||
import { TestBed, getDispatchSpyReducer, createTestStore } from 'utils/testbed' | ||
import { mount } from 'enzyme' | ||
import { combineReducers } from 'redux' | ||
|
||
// import { actions } from 'data' | ||
import { coreReducers, paths } from 'blockchain-wallet-v4/src' | ||
import modalsReducer from 'data/modals/reducers' | ||
|
||
import AcceptTerms from './index' | ||
|
||
const { dispatchSpy, spyReducer } = getDispatchSpyReducer() | ||
|
||
describe('Coinify AcceptTerms Modal', () => { | ||
beforeEach(() => { | ||
dispatchSpy.mockClear() | ||
}) | ||
const reducers = { | ||
spy: spyReducer, | ||
modals: modalsReducer, | ||
components: combineReducers({}), | ||
[paths.settingsPath]: coreReducers.settings | ||
} | ||
let store | ||
let wrapper | ||
beforeEach(() => { | ||
store = createTestStore(reducers) | ||
wrapper = mount( | ||
<TestBed store={store}> | ||
<AcceptTerms /> | ||
</TestBed> | ||
) | ||
}) | ||
|
||
describe('modal rendering', () => { | ||
it('should render', () => { | ||
expect(wrapper.find('Field[name="terms"]')).toHaveLength(1) | ||
}) | ||
|
||
it('should should be disabled with terms not clicked', () => { | ||
expect(wrapper.find('Field[name="terms"]').find('input').props().checked).toBe(false) | ||
expect(wrapper.find('button').props().disabled).toBe(true) | ||
}) | ||
}) | ||
}) |
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