diff --git a/test/reducers/__snapshots__/channels.spec.js.snap b/test/reducers/__snapshots__/channels.spec.js.snap index baf6af43..62a63fe2 100644 --- a/test/reducers/__snapshots__/channels.spec.js.snap +++ b/test/reducers/__snapshots__/channels.spec.js.snap @@ -106,70 +106,6 @@ Object { } `; -exports[`reducers channelsReducer should correctly setChannelForm 2`] = ` -Object { - "channel": null, - "channelForm": Object { - "isOpen": false, - "local_amt": "", - "node_key": "", - "push_amt": "", - }, - "channels": Array [], - "channelsLoading": true, - "openingChannel": false, - "pendingChannels": Object { - "pending_closing_channels": Array [], - "pending_force_closing_channels": Array [], - "pending_open_channels": Array [], - "total_limbo_balance": "", - }, -} -`; - -exports[`reducers channelsReducer should correctly setChannelForm 3`] = ` -Object { - "channel": null, - "channelForm": Object { - "isOpen": false, - "local_amt": "", - "node_key": "", - "push_amt": "", - }, - "channels": Array [ - 1, - 2, - ], - "channelsLoading": false, - "openingChannel": false, - "pendingChannels": Array [ - 3, - 4, - ], -} -`; - -exports[`reducers channelsReducer should correctly setChannelForm 4`] = ` -Object { - "channel": null, - "channelForm": Object { - "isOpen": false, - "local_amt": "", - "node_key": "", - "push_amt": "", - }, - "channels": Array [], - "channelsLoading": false, - "openingChannel": true, - "pendingChannels": Object { - "pending_closing_channels": Array [], - "pending_force_closing_channels": Array [], - "pending_open_channels": Array [], - "total_limbo_balance": "", - }, -} -`; - exports[`reducers channelsReducer should handle initial state 1`] = ` Object { "channel": null, diff --git a/test/reducers/__snapshots__/peers.spec.js.snap b/test/reducers/__snapshots__/peers.spec.js.snap new file mode 100644 index 00000000..2ce6879a --- /dev/null +++ b/test/reducers/__snapshots__/peers.spec.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`reducers peersReducer should handle initial state 1`] = ` +Object { + "connecting": false, + "disconnecting": false, + "peer": null, + "peerForm": Object { + "host": "", + "isOpen": false, + "pubkey": "", + }, + "peers": Array [], + "peersLoading": false, +} +`; diff --git a/test/reducers/peers.spec.js b/test/reducers/peers.spec.js new file mode 100644 index 00000000..d21d7eb5 --- /dev/null +++ b/test/reducers/peers.spec.js @@ -0,0 +1,64 @@ +import peersReducer, { + CONNECT_PEER, + CONNECT_SUCCESS, + CONNECT_FAILURE, + DISCONNECT_PEER, + DISCONNECT_SUCCESS, + DISCONNECT_FAILURE, + SET_PEER_FORM, + SET_PEER, + GET_PEERS, + RECEIVE_PEERS +} from '../../app/reducers/peers' + +describe('reducers', () => { + describe('peersReducer', () => { + it('should handle initial state', () => { + expect(peersReducer(undefined, {})).toMatchSnapshot() + }) + + it('should have CONNECT_PEER', () => { + expect(CONNECT_PEER).toEqual('CONNECT_PEER') + }) + + it('should have CONNECT_SUCCESS', () => { + expect(CONNECT_SUCCESS).toEqual('CONNECT_SUCCESS') + }) + + it('should have CONNECT_FAILURE', () => { + expect(CONNECT_FAILURE).toEqual('CONNECT_FAILURE') + }) + + it('should have DISCONNECT_PEER', () => { + expect(DISCONNECT_PEER).toEqual('DISCONNECT_PEER') + }) + + it('should have DISCONNECT_SUCCESS', () => { + expect(DISCONNECT_SUCCESS).toEqual('DISCONNECT_SUCCESS') + }) + + it('should have DISCONNECT_FAILURE', () => { + expect(DISCONNECT_FAILURE).toEqual('DISCONNECT_FAILURE') + }) + + it('should have SET_PEER_FORM', () => { + expect(SET_PEER_FORM).toEqual('SET_PEER_FORM') + }) + + it('should have SET_PEER', () => { + expect(SET_PEER).toEqual('SET_PEER') + }) + + it('should have GET_PEERS', () => { + expect(GET_PEERS).toEqual('GET_PEERS') + }) + + it('should have RECEIVE_PEERS', () => { + expect(RECEIVE_PEERS).toEqual('RECEIVE_PEERS') + }) + + // it('should correctly sendPayment', () => { + // expect(peersReducer(undefined, { type: SET_PAYMENT, payment: 'foo' })).toMatchSnapshot() + // }) + }) +})