New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uxcore-badge

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uxcore-badge - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

build/Badge.less

8

package.json
{
"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 [![Dependency Status](http://img.shields.io/david/uxcore/uxcore-badge.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-badge) [![devDependency Status](http://img.shields.io/david/dev/uxcore/uxcore-badge.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-badge#info=devDependencies)
## uxcore-badge
[![Test Coverage](https://img.shields.io/coveralls/uxcore/uxcore-badge.svg?style=flat-square)](https://coveralls.io/r/uxcore/uxcore-badge?branch=master)
[![Dependency Status](http://img.shields.io/david/uxcore/uxcore-badge.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-badge)
[![devDependency Status](http://img.shields.io/david/dev/uxcore/uxcore-badge.svg?style=flat-square)](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);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc