1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Add reducer test

This commit is contained in:
ivaosthu 2017-11-29 10:01:12 +01:00
parent 61f7db603d
commit 5a15396ce4
3 changed files with 43 additions and 20 deletions

View File

@ -1,22 +1,22 @@
module.exports = {
Card: "react-mdl-Card",
CardTitle: "react-mdl-CardTitle",
CardText: "react-mdl-CardText",
CardMenu: "react-mdl-CardMenu",
DataTable: "react-mdl-DataTable",
Cell: "react-mdl-Cell",
Grid: "react-mdl-Grid",
Icon: "react-mdl-Icon",
IconButton: "react-mdl-IconButton",
List: "react-mdl-List",
ListItem: "react-mdl-ListItem",
ListItemContent: "react-mdl-ListItemContent",
ProgressBar: "react-mdl-ProgressBar",
Switch: "react-mdl-Switch",
Tab: "react-mdl-Tab",
Tabs: "react-mdl-Tabs",
TableHeader: "react-mdl-TableHeader",
Textfield: "react-mdl-Textfield",
FooterSection: "react-mdl-FooterSection",
FooterLinkList: "react-mdl-FooterLinkList"
Card: 'react-mdl-Card',
CardTitle: 'react-mdl-CardTitle',
CardText: 'react-mdl-CardText',
CardMenu: 'react-mdl-CardMenu',
DataTable: 'react-mdl-DataTable',
Cell: 'react-mdl-Cell',
Grid: 'react-mdl-Grid',
Icon: 'react-mdl-Icon',
IconButton: 'react-mdl-IconButton',
List: 'react-mdl-List',
ListItem: 'react-mdl-ListItem',
ListItemContent: 'react-mdl-ListItemContent',
ProgressBar: 'react-mdl-ProgressBar',
Switch: 'react-mdl-Switch',
Tab: 'react-mdl-Tab',
Tabs: 'react-mdl-Tabs',
TableHeader: 'react-mdl-TableHeader',
Textfield: 'react-mdl-Textfield',
FooterSection: 'react-mdl-FooterSection',
FooterLinkList: 'react-mdl-FooterLinkList',
};

View File

@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

View File

@ -0,0 +1,18 @@
import apiReducer from '../index';
import { RECIEVE_API_DETAILS } from '../actions';
test('should have inital state', () => {
const store = apiReducer(undefined, {});
expect(store.toJS()).toEqual({});
});
test('should have new state', () => {
const store = apiReducer(undefined, { type: RECIEVE_API_DETAILS, value: { version: '1.1.1' } });
expect(store.toJS()).toEqual({ version: '1.1.1' });
});
test('should have updated state', () => {
const inital = apiReducer(undefined, { type: RECIEVE_API_DETAILS, value: { version: '1.1.1' } });
const store = apiReducer(inital, { type: RECIEVE_API_DETAILS, value: { version: '1.2.1' } });
expect(store.toJS()).toEqual({ version: '1.2.1' });
});