it('should call client.events.update', () => { const update = sinon.spy(() => ({})); const reducer = createUpdateReducer({ updateClient: update, }); reducer(initialState, actions.nextState()); update.should.be.calledTwice(); update.getCall(0).args[0].should.eql({ cluster: expectedCluster, client: { id: 'a', data: { counter: 0 }, clusterID: 'A', }, }); update.getCall(1).args[0].should.eql({ cluster: expectedCluster, client: { id: 'b', data: { counter: 2 }, clusterID: 'A', }, }); });
it('should call cluster.events.update', () => { const update = sinon.spy(() => ({})); const reducer = createUpdateReducer({ updateCluster: update, }); reducer(initialState, actions.nextState()); update.should.be.calledOnce(); update.getCall(0).args[0].should.eql(expectedCluster); });