uxcore-badge
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "uxcore-badge", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "uxcore-badge component for uxcore.", | ||
@@ -36,4 +36,4 @@ "repository": "https://github.com/uxcore/uxcore-badge.git", | ||
"console-polyfill": "^0.2.2", | ||
"enzyme": "^3.0.0", | ||
"enzyme-adapter-react-15": "^1.0.0", | ||
"enzyme": "^3.3.0", | ||
"enzyme-adapter-react-15": "^1.0.5", | ||
"es5-shim": "^4.5.8", | ||
@@ -51,3 +51,3 @@ "expect.js": "~0.3.1", | ||
"classnames": "^2.1.2", | ||
"css-animation": "~1.2.5", | ||
"css-animation": "^1.2.5", | ||
"object-assign": "^4.0.0", | ||
@@ -54,0 +54,0 @@ "prop-types": "15.x", |
--- | ||
## uxcore-badge [](https://david-dm.org/uxcore/uxcore-badge) [](https://david-dm.org/uxcore/uxcore-badge#info=devDependencies) | ||
## uxcore-badge | ||
[](https://coveralls.io/r/uxcore/uxcore-badge?branch=master) | ||
[](https://david-dm.org/uxcore/uxcore-badge) | ||
[](https://david-dm.org/uxcore/uxcore-badge#info=devDependencies) | ||
## TL;DR | ||
@@ -6,0 +10,0 @@ |
import expect from 'expect.js'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import TestUtils, { Simulate } from 'react-addons-test-utils'; | ||
import Enzyme, { mount } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-15'; | ||
import Badge from '../src'; | ||
describe('Badge', () => { | ||
Enzyme.configure({ adapter: new Adapter() }); | ||
describe('Uxcore Badge', () => { | ||
it('should be able to render count with 1 digit', () => { | ||
const wrapper = mount(<Badge count={3} />); | ||
const values = wrapper.find('.kuma-badge-count .current'); | ||
const mergedValue = values.map(el => el.text()).join(''); | ||
expect(mergedValue).to.be('3'); | ||
}); | ||
it('should be able to render count with 2 digits', () => { | ||
const wrapper = mount(<Badge count={23} />); | ||
const values = wrapper.find('.kuma-badge-count .current'); | ||
const mergedValue = values.map(el => el.text()).join(''); | ||
expect(mergedValue).to.be('23'); | ||
}); | ||
it('should be able to render dot', () => { | ||
const wrapper = mount(<Badge dot={true} />); | ||
const dot = wrapper.find('sup.kuma-badge-dot'); | ||
expect(dot).to.have.length(1); | ||
}); | ||
it('should be able to render text', () => { | ||
const wrapper = mount(<Badge text={'test123'} />); | ||
const text = wrapper.find('sup.kuma-badge-count').text(); | ||
expect(text).to.be('test123'); | ||
}); | ||
it('should be able to change count', (done) => { | ||
const wrapper = mount(<Badge count={23} />); | ||
wrapper.setProps({ count: 45 }); | ||
setTimeout(() => { | ||
const values = wrapper.update().find('.kuma-badge-count .current'); | ||
const mergedValue = values.map(el => el.text()).join(''); | ||
expect(mergedValue).to.be('45'); | ||
done(); | ||
}, 10); | ||
}); | ||
it('should be able to change count without animation', (done) => { | ||
const wrapper = mount(<Badge count={23} />); | ||
wrapper.setState({ animationEnabled: false }); | ||
wrapper.setProps({ count: 45 }); | ||
setTimeout(() => { | ||
const values = wrapper.update().find('.kuma-badge-count .current'); | ||
const mergedValue = values.map(el => el.text()).join(''); | ||
expect(mergedValue).to.be('45'); | ||
done(); | ||
}, 10); | ||
}); | ||
}); |
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
39110
20
675
40
0
- Removedcss-animation@1.2.6(transitive)
Updatedcss-animation@^1.2.5