Browse Source

fix(tests): new jest snapshots

renovate/lint-staged-8.x
Jack Mallers 8 years ago
parent
commit
58113389f0
  1. 64
      test/reducers/__snapshots__/channels.spec.js.snap
  2. 16
      test/reducers/__snapshots__/peers.spec.js.snap
  3. 64
      test/reducers/peers.spec.js

64
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`] = ` exports[`reducers channelsReducer should handle initial state 1`] = `
Object { Object {
"channel": null, "channel": null,

16
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,
}
`;

64
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()
// })
})
})
Loading…
Cancel
Save