UNPKG

798 BJavaScriptView Raw
1"use strict";
2
3var _recompose = require("recompose");
4
5var _uiReductions = require("./ui-reductions");
6
7test('activateLoading', function () {
8 var uiState = {
9 foo: 'foo'
10 };
11 expect((0, _uiReductions.activateLoading)(uiState)).toEqual({
12 foo: 'foo',
13 isLoading: true
14 });
15 expect((0, _recompose.compose)(_uiReductions.activateLoading)(uiState)).toEqual({
16 foo: 'foo',
17 isLoading: true
18 });
19});
20test('addOneNotification', function () {
21 var uiState = {
22 notifications: []
23 };
24 expect((0, _uiReductions.addOneNotification)(uiState, 'notif')).toEqual({
25 notifications: [{
26 message: 'notif'
27 }]
28 });
29 expect((0, _recompose.compose)((0, _uiReductions.addOneNotification)('notif'))(uiState)).toEqual({
30 notifications: [{
31 message: 'notif'
32 }]
33 });
34});
\No newline at end of file