sharyn
Version:
Combines all the other packages under one.
126 lines (123 loc) • 2.74 kB
JavaScript
"use strict";
var _recompose = require("recompose");
var _uiReductions = require("./ui-reductions");
test('activatePageLoading', function () {
expect((0, _uiReductions.activatePageLoading)({
foo: 'foo'
})).toEqual({
foo: 'foo',
isPageLoading: true
});
expect((0, _recompose.compose)(_uiReductions.activatePageLoading)({
foo: 'foo'
})).toEqual({
foo: 'foo',
isPageLoading: true
});
});
test('deactivatePageLoading', function () {
expect((0, _uiReductions.deactivatePageLoading)({
foo: 'foo',
isPageLoading: true
})).toEqual({
foo: 'foo'
});
expect((0, _recompose.compose)(_uiReductions.deactivatePageLoading)({
foo: 'foo',
isPageLoading: true
})).toEqual({
foo: 'foo'
});
});
test('activateComponentLoading', function () {
expect((0, _uiReductions.activateComponentLoading)({
foo: 'foo'
}, undefined)).toEqual({
foo: 'foo'
});
expect((0, _uiReductions.activateComponentLoading)({
foo: 'foo'
}, 'blep')).toEqual({
foo: 'foo',
loadingComponents: {
blep: true
}
});
expect((0, _uiReductions.activateComponentLoading)({
foo: 'foo',
loadingComponents: {
bar: true
}
}, 'blep')).toEqual({
foo: 'foo',
loadingComponents: {
bar: true,
blep: true
}
});
expect((0, _recompose.compose)((0, _uiReductions.activateComponentLoading)('blep'))({
foo: 'foo'
})).toEqual({
foo: 'foo',
loadingComponents: {
blep: true
}
});
});
test('deactivateComponentLoading', function () {
expect((0, _uiReductions.deactivateComponentLoading)({
foo: 'foo',
loadingComponents: {
blep: true
}
}, undefined)).toEqual({
foo: 'foo',
loadingComponents: {
blep: true
}
});
expect((0, _uiReductions.deactivateComponentLoading)({
foo: 'foo',
loadingComponents: {
blep: true
}
}, 'blep')).toEqual({
foo: 'foo'
});
expect((0, _uiReductions.deactivateComponentLoading)({
foo: 'foo',
loadingComponents: {
bar: true,
blep: true
}
}, 'blep')).toEqual({
foo: 'foo',
loadingComponents: {
bar: true
}
});
expect((0, _recompose.compose)((0, _uiReductions.deactivateComponentLoading)('blep'))({
foo: 'foo',
loadingComponents: {
blep: true
}
})).toEqual({
foo: 'foo'
});
});
test('addOneNotification', function () {
expect((0, _uiReductions.addOneNotification)({
notifications: []
}, 'notif')).toEqual({
notifications: [{
message: 'notif'
}]
});
expect((0, _recompose.compose)((0, _uiReductions.addOneNotification)('notif'))({
notifications: []
})).toEqual({
notifications: [{
message: 'notif'
}]
});
});