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:
parent
61f7db603d
commit
5a15396ce4
40
frontend/src/__mocks__/react-mdl.js
vendored
40
frontend/src/__mocks__/react-mdl.js
vendored
@ -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',
|
||||
};
|
||||
|
5
frontend/src/store/api/__tests__/.eslintrc
Normal file
5
frontend/src/store/api/__tests__/.eslintrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
18
frontend/src/store/api/__tests__/api-store-tests.js
Normal file
18
frontend/src/store/api/__tests__/api-store-tests.js
Normal 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' });
|
||||
});
|
Loading…
Reference in New Issue
Block a user