diff options
Unify test suites
Diffstat (limited to 'test/unit/actions/warning_test.js')
-rw-r--r-- | test/unit/actions/warning_test.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/actions/warning_test.js b/test/unit/actions/warning_test.js new file mode 100644 index 000000000..37be9ee85 --- /dev/null +++ b/test/unit/actions/warning_test.js @@ -0,0 +1,24 @@ +var jsdom = require('mocha-jsdom') +var assert = require('assert') +var freeze = require('deep-freeze-strict') +var path = require('path') + +var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js')) +var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js')) + +describe('action DISPLAY_WARNING', function() { + + it('sets appState.warning to provided value', function() { + var initialState = { + appState: {}, + } + freeze(initialState) + + const warningText = 'This is a sample warning message' + + const action = actions.displayWarning(warningText) + const resultingState = reducers(initialState, action) + + assert.equal(resultingState.appState.warning, warningText, 'warning text set') + }); +}); |