|
| 1 | +// import * as Action from '../../lib/actions/actions'; |
| 2 | +// import {expect} from 'chai'; |
| 3 | +// |
| 4 | +// xdescribe('action creators: ', () => { |
| 5 | +// |
| 6 | +// it('setProject', () => { |
| 7 | +// expect(Action.setProject('./path/to/file.js')) |
| 8 | +// .to.deep.equal({ type: 'SET_PROJECT', payload: { filePath: './path/to/file.js' }}); |
| 9 | +// }); |
| 10 | +// |
| 11 | +// it('setPage with no input', () => { |
| 12 | +// expect(Action.setPage()) |
| 13 | +// .to.deep.equal({ type: 'SET_PAGE', payload: { position: { chapter: 0, page: 0, task: 0 }}}); |
| 14 | +// }); |
| 15 | +// |
| 16 | +// it('setPage with input', () => { |
| 17 | +// expect(Action.setPage({ chapter: 1, page: 1, task: 1 })) |
| 18 | +// .to.deep.equal({ type: 'SET_PAGE', payload: { position: { chapter: 1, page: 1, task: 1 }}}); |
| 19 | +// }); |
| 20 | +// |
| 21 | +// it('setRoute', () => { |
| 22 | +// expect(Action.setRoute('page')).to.deep.equal({ type: 'SET_ROUTE', payload: { route: 'page' }}); |
| 23 | +// }); |
| 24 | +// |
| 25 | +// it('setPosition', () => { |
| 26 | +// const position = { chapter: 0, page: 1, task: 2 }; |
| 27 | +// const action = Action.setPosition(position); |
| 28 | +// expect(action).to.deep.equal({ type: 'SET_POSITION', payload: { position }}); |
| 29 | +// }); |
| 30 | +// |
| 31 | +// it('nextTask', (taskLength: number) => { |
| 32 | +// const action = Action.nextTask(); |
| 33 | +// expect(action).to.deep.equal({ type: 'NEXT_TASK', payload: { taskLength }}); |
| 34 | +// }); |
| 35 | +// |
| 36 | +// it('prevTask', () => { |
| 37 | +// const action = Action.prevTask(); |
| 38 | +// expect(action).to.deep.equal({ type: 'PREV_TASK' }); |
| 39 | +// }); |
| 40 | +// |
| 41 | +// it('setCompleted with lowercase input', () => { |
| 42 | +// const position = { chapter: 0, page: 0, task: 0 }; |
| 43 | +// const action = Action.setCompleted('task', true, position); |
| 44 | +// expect(action) |
| 45 | +// .to.deep.equal({ type: 'SET_COMPLETED', payload: { target: 'TASK', completed: true, position }}); |
| 46 | +// }); |
| 47 | +// |
| 48 | +// }); |