From 014a636be3597576c22137536ded473fb3d134e4 Mon Sep 17 00:00:00 2001 From: Lucas Constantino Silva Date: Sun, 17 Jul 2016 14:13:28 -0300 Subject: [PATCH] Added module initial state tests. --- test/bootstrap.test.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/bootstrap.test.js b/test/bootstrap.test.js index 5c42efc..da3a5b1 100644 --- a/test/bootstrap.test.js +++ b/test/bootstrap.test.js @@ -44,6 +44,23 @@ test('Boostrap new app with an initial state', assert => { }) }) +test('Boostrap new app with initial state on modules', assert => { + const testModule = { initialState: { foo: 'bar' } } + + const app = boot(null, [testModule]) + + app.then(({action, store}) => { + + assert.deepEqual( + store.getState(), + testModule.initialState, + 'State is equal to module\'s initial state' + ) + + assert.end() + }) +}) + test('Boostrap new app with a module implementing a reducer', assert => { const initialState = { foo: 'bar' @@ -212,4 +229,4 @@ test('Boostrap new app with a module implementing an enhancer', assert => { assert.end() }) -}) \ No newline at end of file +})