diff --git a/test/helpers/SaaM.js b/test/helpers/SaaM.js index 0fda0912..18568d19 100644 --- a/test/helpers/SaaM.js +++ b/test/helpers/SaaM.js @@ -1,15 +1,7 @@ -import actions from './SampleActions' - export const displayName = 'SaaM' -export const bindListeners = { - handleClick: actions.FIRE -} - -export const state = { - data: 1 -} +export const state = 1 -export function handleClick(data) { - this.state.data = data +export function reduce(state, payload) { + return state + 1 } diff --git a/test/store-as-a-module.js b/test/store-as-a-module.js index 55b5b8b2..56556c40 100644 --- a/test/store-as-a-module.js +++ b/test/store-as-a-module.js @@ -1,23 +1,24 @@ import assert from 'assert' +import Alt from '../' -import alt from './helpers/alt' -import actions from './helpers/SampleActions' import * as StoreModel from './helpers/SaaM' +const alt = new Alt() +const actions = alt.generateActions('increment') const store = alt.createStore(StoreModel) export default { 'Stores as a Module': { - beforeEach() { - alt.recycle() - }, - 'store state is there'() { - assert.equal(store.getState().data, 1, 'store data is initialized to 1') + assert.equal(store.getState(), 1, 'store data is initialized to 1') + + actions.increment() + + assert.equal(store.getState(), 2, 'store data was updated') - actions.fire(2) + actions.increment() - assert.equal(store.getState().data, 2, 'store data was updated') + assert.equal(store.getState(), 3, 'incremented again') } } }