feat(tests): basic tests for grid components

This commit is contained in:
Julien Fontanet
2016-12-07 14:05:43 +01:00
parent 416c98ffd2
commit 919aa5fc43
3 changed files with 35 additions and 0 deletions

View File

@@ -57,6 +57,8 @@
"cookies-js": "^1.2.2",
"d3": "^4.2.8",
"dependency-check": "^2.5.1",
"enzyme": "^2.6.0",
"enzyme-to-json": "^1.4.4",
"event-to-promise": "^0.7.0",
"font-awesome": "^4.5.0",
"font-mfizz": "github:fizzed/font-mfizz",
@@ -94,6 +96,7 @@
"random-password": "^0.1.2",
"react": "^15.0.0",
"react-addons-shallow-compare": "^15.1.0",
"react-addons-test-utils": "^15.4.1",
"react-bootstrap-4": "^0.29.1",
"react-chartist": "^0.11.0",
"react-copy-to-clipboard": "^4.0.2",
@@ -178,6 +181,11 @@
"commit-msg": "npm test"
}
},
"jest": {
"snapshotSerializers": [
"<rootDir>/node_modules/enzyme-to-json/serializer"
]
},
"standard": {
"ignore": [
"dist"

View File

@@ -0,0 +1,14 @@
exports[`test Col 1`] = `
<div
className="col-xs-12" />
`;
exports[`test Container 1`] = `
<div
className="container-fluid" />
`;
exports[`test Row 1`] = `
<div
className=" row" />
`;

13
src/common/grid.spec.js Normal file
View File

@@ -0,0 +1,13 @@
/* eslint-env jest */
import React from 'react'
import { forEach } from 'lodash'
import { shallow } from 'enzyme'
import * as grid from './grid'
forEach(grid, (Component, name) => {
it(name, () => {
expect(shallow(<Component />)).toMatchSnapshot()
})
})