-
Notifications
You must be signed in to change notification settings - Fork 23
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
6 changed files
with
95 additions
and
17 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
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,25 @@ | ||
import React from 'react' | ||
import { mount } from 'enzyme' | ||
import { Provider } from 'react-redux' | ||
import configureMockStore from 'redux-mock-store' | ||
import BudgetChart from '../BudgetChart' | ||
import { initialState as transactionsInitialState } from '../../../store/transactions/reducer' | ||
import { initialState as settingsInitialState } from '../../../store/settings/reducer' | ||
import { initialState as budgetInitialState } from '../../../store/budget/reducer' | ||
|
||
describe('BudgetChart', () => { | ||
it('matches snapshot with no used categories', () => { | ||
const mockStore = configureMockStore() | ||
const store = mockStore({ | ||
transactions: transactionsInitialState, | ||
settings: settingsInitialState, | ||
budget: budgetInitialState | ||
}) | ||
const wrapper = mount(( | ||
<Provider store={store}> | ||
<BudgetChart /> | ||
</Provider> | ||
)) | ||
expect(wrapper.debug()).toMatchSnapshot() | ||
}) | ||
}) |
16 changes: 16 additions & 0 deletions
16
src/core/Budget/__tests__/__snapshots__/BudgetChart.test.jsx.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BudgetChart matches snapshot with no used categories 1`] = ` | ||
"<Provider store={{...}}> | ||
<BudgetChart> | ||
<ResponsiveContainer width=\\"100%\\" height=\\"100%\\" debounce={0}> | ||
<div id={[undefined]} className=\\"recharts-responsive-container\\" style={{...}}> | ||
<LineChart data={{...}} margin={{...}} layout=\\"horizontal\\" stackOffset=\\"none\\" barCategoryGap=\\"10%\\" barGap={4} reverseStackOrder={false} width={0} height={0} /> | ||
<ResizeDetector handleWidth={true} handleHeight={true} onResize={[Function]} skipOnMount={false} refreshRate={1000} refreshMode={[undefined]} resizableElementId=\\"\\"> | ||
<div style={{...}} /> | ||
</ResizeDetector> | ||
</div> | ||
</ResponsiveContainer> | ||
</BudgetChart> | ||
</Provider>" | ||
`; |
17 changes: 17 additions & 0 deletions
17
src/core/Budget/__tests__/__snapshots__/index.test.jsx.snap
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,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BudgetIndex matches snapshot with no accounts 1`] = ` | ||
"<Provider store={{...}}> | ||
<Connect(WithStyles(BudgetIndexComponent))> | ||
<WithStyles(BudgetIndexComponent) budget={{...}} dispatch={[Function: dispatch]}> | ||
<BudgetIndexComponent classes={{...}} budget={{...}} dispatch={[Function: dispatch]}> | ||
<WithStyles(ForwardRef(Container)) className=\\"BudgetIndexComponent-root-1\\"> | ||
<ForwardRef(Container) classes={{...}} className=\\"BudgetIndexComponent-root-1\\"> | ||
<div className=\\"MuiContainer-root BudgetIndexComponent-root-1 MuiContainer-maxWidthLg\\" /> | ||
</ForwardRef(Container)> | ||
</WithStyles(ForwardRef(Container))> | ||
</BudgetIndexComponent> | ||
</WithStyles(BudgetIndexComponent)> | ||
</Connect(WithStyles(BudgetIndexComponent))> | ||
</Provider>" | ||
`; |
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 { mount } from 'enzyme' | ||
import { Provider } from 'react-redux' | ||
import configureMockStore from 'redux-mock-store' | ||
import BudgetIndex from '..' | ||
import { initialState as budgetInitialState } from '../../../store/budget/reducer' | ||
|
||
describe('BudgetIndex', () => { | ||
it('matches snapshot with no accounts', () => { | ||
const mockStore = configureMockStore() | ||
const store = mockStore({ | ||
budget: budgetInitialState | ||
}) | ||
const wrapper = mount(( | ||
<Provider store={store}> | ||
<BudgetIndex /> | ||
</Provider> | ||
)) | ||
expect(wrapper.debug()).toMatchSnapshot() | ||
}) | ||
}) |
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