mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-03 06:34:27 +01:00
25 lines
760 B
JavaScript
25 lines
760 B
JavaScript
|
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, '..', '..', '..', 'app', 'actions.js'))
|
||
|
var reducers = require(path.join(__dirname, '..', '..', '..', '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')
|
||
|
});
|
||
|
});
|