tick.js 608 B

123456789101112131415161718192021
  1. import assert from 'assert';
  2. import { StoreWrapper } from 'misago/services/store';
  3. import reducer, { initialState, doTick } from 'misago/reducers/tick';
  4. var store = null;
  5. describe("Tick", function() {
  6. beforeEach(function() {
  7. store = new StoreWrapper();
  8. store.addReducer('tick', reducer, initialState);
  9. store.init();
  10. });
  11. it("tick action increases ticks count", function() {
  12. store.dispatch(doTick());
  13. assert.equal(store.getState().tick.tick, 1, "tick was counted");
  14. store.dispatch(doTick());
  15. assert.equal(store.getState().tick.tick, 2, "tick was counted again");
  16. });
  17. });