Tom Kirkpatrick
6 years ago
2 changed files with 316 additions and 0 deletions
@ -0,0 +1,241 @@ |
|||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly changeFilter 1`] = ` |
||||
|
Object { |
||||
|
"filter": undefined, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
"showCurrencyFilters": false, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly hideActivityModal 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly setActivityModalCurrencyFilters 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
"showCurrencyFilters": undefined, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly showActivityModal 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": undefined, |
||||
|
"itemType": undefined, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly togglePulldown 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": true, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
"showCurrencyFilters": false, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly updateSearchActive 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
"showCurrencyFilters": false, |
||||
|
}, |
||||
|
"searchActive": undefined, |
||||
|
"searchText": "", |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers activityReducer should correctly updateSearchText 1`] = ` |
||||
|
Object { |
||||
|
"filter": Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All Activity", |
||||
|
}, |
||||
|
"filterPulldown": false, |
||||
|
"filters": Array [ |
||||
|
Object { |
||||
|
"key": "ALL_ACTIVITY", |
||||
|
"name": "All", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "SENT_ACTIVITY", |
||||
|
"name": "Sent", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "REQUESTED_ACTIVITY", |
||||
|
"name": "Requested", |
||||
|
}, |
||||
|
Object { |
||||
|
"key": "PENDING_ACTIVITY", |
||||
|
"name": "Pending", |
||||
|
}, |
||||
|
], |
||||
|
"modal": Object { |
||||
|
"itemId": null, |
||||
|
"itemType": null, |
||||
|
"showCurrencyFilters": false, |
||||
|
}, |
||||
|
"searchActive": false, |
||||
|
"searchText": undefined, |
||||
|
} |
||||
|
`; |
@ -0,0 +1,75 @@ |
|||||
|
import activityReducer, { |
||||
|
SHOW_ACTIVITY_MODAL, |
||||
|
HIDE_ACTIVITY_MODAL, |
||||
|
CHANGE_FILTER, |
||||
|
TOGGLE_PULLDOWN, |
||||
|
SET_ACTIVITY_MODAL_CURRENCY_FILTERS, |
||||
|
UPDATE_SEARCH_ACTIVE, |
||||
|
UPDATE_SEARCH_TEXT |
||||
|
} from 'reducers/activity' |
||||
|
|
||||
|
describe('reducers', () => { |
||||
|
describe('activityReducer', () => { |
||||
|
it('should have SHOW_ACTIVITY_MODAL', () => { |
||||
|
expect(SHOW_ACTIVITY_MODAL).toEqual('SHOW_ACTIVITY_MODAL') |
||||
|
}) |
||||
|
|
||||
|
it('should have HIDE_ACTIVITY_MODAL', () => { |
||||
|
expect(HIDE_ACTIVITY_MODAL).toEqual('HIDE_ACTIVITY_MODAL') |
||||
|
}) |
||||
|
|
||||
|
it('should have CHANGE_FILTER', () => { |
||||
|
expect(CHANGE_FILTER).toEqual('CHANGE_FILTER') |
||||
|
}) |
||||
|
|
||||
|
it('should have TOGGLE_PULLDOWN', () => { |
||||
|
expect(TOGGLE_PULLDOWN).toEqual('TOGGLE_PULLDOWN') |
||||
|
}) |
||||
|
|
||||
|
it('should have SET_ACTIVITY_MODAL_CURRENCY_FILTERS', () => { |
||||
|
expect(SET_ACTIVITY_MODAL_CURRENCY_FILTERS).toEqual('SET_ACTIVITY_MODAL_CURRENCY_FILTERS') |
||||
|
}) |
||||
|
|
||||
|
it('should have UPDATE_SEARCH_ACTIVE', () => { |
||||
|
expect(UPDATE_SEARCH_ACTIVE).toEqual('UPDATE_SEARCH_ACTIVE') |
||||
|
}) |
||||
|
|
||||
|
it('should have UPDATE_SEARCH_TEXT', () => { |
||||
|
expect(UPDATE_SEARCH_TEXT).toEqual('UPDATE_SEARCH_TEXT') |
||||
|
}) |
||||
|
|
||||
|
it('should correctly showActivityModal', () => { |
||||
|
expect(activityReducer(undefined, { type: SHOW_ACTIVITY_MODAL })).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly hideActivityModal', () => { |
||||
|
expect( |
||||
|
activityReducer(undefined, { type: HIDE_ACTIVITY_MODAL, invoices: [1, 2] }) |
||||
|
).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly changeFilter', () => { |
||||
|
expect(activityReducer(undefined, { type: CHANGE_FILTER })).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly togglePulldown', () => { |
||||
|
expect( |
||||
|
activityReducer(undefined, { type: TOGGLE_PULLDOWN, invoice: 'foo' }) |
||||
|
).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly setActivityModalCurrencyFilters', () => { |
||||
|
expect( |
||||
|
activityReducer(undefined, { type: SET_ACTIVITY_MODAL_CURRENCY_FILTERS }) |
||||
|
).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly updateSearchActive', () => { |
||||
|
expect(activityReducer(undefined, { type: UPDATE_SEARCH_ACTIVE })).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly updateSearchText', () => { |
||||
|
expect(activityReducer(undefined, { type: UPDATE_SEARCH_TEXT })).toMatchSnapshot() |
||||
|
}) |
||||
|
}) |
||||
|
}) |
Loading…
Reference in new issue