@govuk-frederic/count
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -32,7 +32,3 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
Count.propTypes = process.env.NODE_ENV !== "production" ? { | ||
textClass: PropTypes.string, | ||
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired | ||
} : {}; | ||
export default Count; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import Component from '.'; | ||
import { mount, shallow } from 'enzyme'; | ||
import Count from '.'; | ||
describe('Count', function () { | ||
var wrapper; | ||
it('renders without crashing', function () { | ||
wrapper = shallow(React.createElement(Component, { | ||
value: 4 | ||
it('renders with only required props', function () { | ||
var wrapper = shallow(React.createElement(Count, { | ||
value: 2 | ||
})); | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
it('displays number passed in correctly', function () { | ||
var wrapper = shallow(React.createElement(Count, { | ||
value: 4 | ||
})); | ||
expect(wrapper.find('span').text()).toBe('4'); | ||
}); | ||
it('matches snapshot', function () { | ||
var wrapper = mount(React.createElement(Count, { | ||
value: 6 | ||
})); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -16,0 +22,0 @@ }); |
@@ -43,6 +43,2 @@ "use strict"; | ||
Count.propTypes = process.env.NODE_ENV !== "production" ? { | ||
textClass: _propTypes.default.string, | ||
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired | ||
} : {}; | ||
var _default = Count; | ||
@@ -49,0 +45,0 @@ exports.default = _default; |
@@ -12,12 +12,18 @@ "use strict"; | ||
describe('Count', function () { | ||
var wrapper; | ||
it('renders without crashing', function () { | ||
wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, { | ||
value: 4 | ||
it('renders with only required props', function () { | ||
var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, { | ||
value: 2 | ||
})); | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
it('displays number passed in correctly', function () { | ||
var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, { | ||
value: 4 | ||
})); | ||
expect(wrapper.find('span').text()).toBe('4'); | ||
}); | ||
it('matches snapshot', function () { | ||
var wrapper = (0, _enzyme.mount)(_react.default.createElement(_.default, { | ||
value: 6 | ||
})); | ||
expect(wrapper).toMatchSnapshot(); | ||
@@ -24,0 +30,0 @@ }); |
{ | ||
"name": "@govuk-frederic/count", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@govuk-react/constants": "^0.2.7" |
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { mount, shallow } from 'enzyme'; | ||
import Component from '.'; | ||
import Count from '.'; | ||
describe('Count', () => { | ||
let wrapper; | ||
it('renders without crashing', () => { | ||
wrapper = shallow(<Component value={4} />); | ||
it('renders with only required props', () => { | ||
const wrapper = shallow(<Count value={2} />); | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
it('displays number passed in correctly', () => { | ||
const wrapper = shallow(<Count value={4} />); | ||
expect(wrapper.find('span').text()).toBe('4'); | ||
@@ -18,4 +18,5 @@ }); | ||
it('matches snapshot', () => { | ||
const wrapper = mount(<Count value={6} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
15832
195
1
0