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

react-star-rating-input

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-star-rating-input - npm Package Compare versions

Comparing version 3.1.0 to 4.0.0

4

demo.js

@@ -10,3 +10,3 @@ (function () {

render: function () {
return StarRatingInput.Klass({
return React.createElement(StarRatingInput.Klass, {
value: this.state.value,

@@ -23,3 +23,3 @@ onChange: function (value) { this.setState({value: value}); }.bind(this)

insertCss(StarRatingInput.css);
React.renderComponent(Container(), global.document.body);
React.render(React.createElement(Container), global.document.body);
}());
{
"name": "react-star-rating-input",
"version": "3.1.0",
"version": "4.0.0",
"description": "React.js component for entering 0-5 stars",

@@ -40,9 +40,10 @@ "main": "index.js",

"dependencies": {
"react": "^0.11.2"
"react": "^0.12.0"
},
"devDependencies": {
"brfs": "^1.2.0",
"browserify": "^5.11.2",
"browserify": "^6.3.2",
"insert-css": "^0.2.0",
"jsdom": "^1.0.0-pre.6",
"jsdom": "^1.2.1",
"jsdom-test-browser": "^2.0.0",
"jshint": "^2.5.5",

@@ -49,0 +50,0 @@ "mocha": "^1.21.4",

@@ -1,4 +0,4 @@

// That module must be really simple. Otherwise, brfs won't work,
// That module must be really simple. Otherwise, brfs won't work.
var fs = require('fs');
module.exports = fs.readFileSync(__dirname + '/../www/styles.css', 'utf8');

@@ -5,4 +5,7 @@ describe('package index', function () {

var assert = require('assert'),
bro = require('jsdom-test-browser'),
api = require('../index.js');
assert(bro);
it('exports the component class', function () {

@@ -9,0 +12,0 @@ assert(api.Klass);

@@ -6,3 +6,4 @@ describe('StarRatingInput', function () {

sinon = require('sinon'),
jsdom = require('jsdom'),
bro = require('jsdom-test-browser'),
React = require('react'),
TestUtils = require('react/addons').addons.TestUtils,

@@ -13,22 +14,6 @@ StarRatingInput = require('../src/StarRatingInput'),

return {value: value, onChange: (onChange ? onChange : function () {})};
},
};
$;
before(function (done) { bro.jQueryify(done); });
this.timeout(4000);
beforeEach(function (done) {
global.document = jsdom.jsdom('<html><body></body></html>', jsdom.level(1, 'core'));
global.window = global.document.parentWindow;
jsdom.jQueryify(global.window, 'http://code.jquery.com/jquery-1.11.0.min.js', function () {
$ = global.window.$;
done();
});
});
afterEach(function () {
global.window.close();
});
['value', 'onChange'].forEach(function (p) {

@@ -44,15 +29,17 @@ it('declares the ' + p + ' property', function () {

beforeEach(function () {
element = TestUtils.renderIntoDocument(StarRatingInput(props(0))).getDOMNode();
element = TestUtils.renderIntoDocument(
React.createElement(StarRatingInput, props(0))
).getDOMNode();
});
it('has the root element\'s class assigned', function () {
assert($(element).hasClass('star-rating-input'));
assert(bro.$(element).hasClass('star-rating-input'));
});
it('has the "Clear" link', function () {
assert.strictEqual($('a.star-rating-clear', element).text(), 'Clear');
assert.strictEqual(bro.$('a.star-rating-clear', element).text(), 'Clear');
});
it('has the 5 star items', function () {
assert.strictEqual($('.star-rating-star-container', element).size(), 5);
assert.strictEqual(bro.$('.star-rating-star-container', element).size(), 5);
});

@@ -63,13 +50,16 @@ });

var assertState = function (element, onCount, offCount, suggestedCount) {
assert.strictEqual($('.star-rating-star-container a.on', element).size(), onCount);
assert.strictEqual(bro.$('.star-rating-star-container a.on', element).size(), onCount);
assert.strictEqual(
$('.star-rating-star-container a.off', element).size(), offCount);
bro.$('.star-rating-star-container a.off', element).size(), offCount);
assert.strictEqual(
$('.star-rating-star-container a.suggested', element).size(), suggestedCount);
bro.$('.star-rating-star-container a.suggested', element).size(), suggestedCount);
},
element = function (value, prospectiveValue) {
var component = TestUtils.renderIntoDocument(StarRatingInput(props(value)));
var component = TestUtils.renderIntoDocument(
React.createElement(StarRatingInput, props(value))
);
component.setState({prospectiveValue: prospectiveValue});

@@ -92,3 +82,5 @@ return component.getDOMNode();

beforeEach(function () {
component = TestUtils.renderIntoDocument(StarRatingInput({onChange: function () {}}));
component = TestUtils.renderIntoDocument(
React.createElement(StarRatingInput, {onChange: function () {}})
);
});

@@ -111,3 +103,7 @@

spy = sinon.spy();
component = TestUtils.renderIntoDocument(StarRatingInput(props(1, spy)));
component = TestUtils.renderIntoDocument(
React.createElement(StarRatingInput, props(1, spy))
);
component.setState({prospectiveValue: 2});

@@ -114,0 +110,0 @@ });

Sorry, the diff of this file is not supported yet

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