Socket
Socket
Sign inDemoInstall

raty-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raty-js - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

2

bower.json

@@ -37,3 +37,3 @@ {

],
"name": "raty",
"name": "raty"
}

@@ -0,1 +1,7 @@

## 3.1.1
### Bugfix
- Fix invalid Bower JSON; [#232](https://github.com/wbotelhos/raty/pull/232) by [Nimmer](https://github.com/Nimmer)
## 3.1.0

@@ -2,0 +8,0 @@

@@ -8,3 +8,3 @@ /*!

* github: wbotelhos/raty
* version: 3.1.0
* version: 3.1.1
*

@@ -11,0 +11,0 @@ */

@@ -56,3 +56,3 @@ {

},
"version": "3.1.0"
"version": "3.1.1"
}

@@ -168,2 +168,143 @@ describe('#iconRangeSame', function() {

});
describe('with cancel option', function() {
describe('after rating', function() {
describe('when mouse over', function() {
it ('removes the range icon', function() {
// given
var self = $('#element');
self.raty({
cancelButton: true,
iconRangeSame: true,
iconRange: [
{ range: 2, on: 'star-on.png', off: 'star-off.png' },
{ range: 3, on: 'star-on.png', off: 'star-off.png' },
{ range: 4, on: 'star-on.png', off: 'star-off.png' },
{ range: 5, on: 'star-on.png', off: 'star-off.png' }
]
});
var stars = self.children('img:not(.raty-cancel)');
stars[4].click();
// when
document.querySelector('.raty-cancel').dispatchEvent(new MouseEvent('mouseover'));
// then
expect(stars[0].src).toMatch('star-off.png');
expect(stars[1].src).toMatch('star-off.png');
expect(stars[2].src).toMatch('star-off.png');
expect(stars[3].src).toMatch('star-off.png');
expect(stars[4].src).toMatch('star-off.png');
});
});
describe('when mouse over and out', function() {
it ('puts the selection back', function() {
// given
var self = $('#element');
self.raty({
cancelButton: true,
iconRangeSame: true,
iconRange: [
{ range: 2, on: 'star-on.png', off: 'star-off.png' },
{ range: 3, on: 'star-on.png', off: 'star-off.png' },
{ range: 4, on: 'star-on.png', off: 'star-off.png' },
{ range: 5, on: 'star-on.png', off: 'star-off.png' }
]
});
var stars = self.children('img:not(.raty-cancel)');
stars[4].click();
var cancel = document.querySelector('.raty-cancel');
cancel.dispatchEvent(new MouseEvent('mouseover'));
// when
self[0].dispatchEvent(new MouseEvent('mouseout'));
// then
expect(stars[0].src).toMatch('star-on.png');
expect(stars[1].src).toMatch('star-on.png');
expect(stars[2].src).toMatch('star-on.png');
expect(stars[3].src).toMatch('star-on.png');
expect(stars[4].src).toMatch('star-on.png');
});
});
describe('when click on cancel button and mouse out', function() {
it ('removes the range icon', function() {
// given
var self = $('#element');
self.raty({
cancelButton: true,
iconRangeSame: true,
iconRange: [
{ range: 2, on: 'star-on.png', off: 'star-off.png' },
{ range: 3, on: 'star-on.png', off: 'star-off.png' },
{ range: 4, on: 'star-on.png', off: 'star-off.png' },
{ range: 5, on: 'star-on.png', off: 'star-off.png' }
]
});
var stars = self.children('img:not(.raty-cancel)');
stars[4].click();
// when
document.querySelector('.raty-cancel').click();
self[0].dispatchEvent(new MouseEvent('mouseout'));
// then
expect(stars[0].src).toMatch('star-off.png');
expect(stars[1].src).toMatch('star-off.png');
expect(stars[2].src).toMatch('star-off.png');
expect(stars[3].src).toMatch('star-off.png');
expect(stars[4].src).toMatch('star-off.png');
});
});
});
});
describe('when call cancel method', function() {
it ('removes the range icon', function() {
// given
var self = $('#element');
self.raty({
cancelButton: true,
iconRangeSame: true,
iconRange: [
{ range: 2, on: 'star-on.png', off: 'star-off.png' },
{ range: 3, on: 'star-on.png', off: 'star-off.png' },
{ range: 4, on: 'star-on.png', off: 'star-off.png' },
{ range: 5, on: 'star-on.png', off: 'star-off.png' }
]
});
var stars = self.children('img:not(.raty-cancel)');
stars[4].click();
// when
self.data('raty').cancel();
// then
expect(stars[0].src).toMatch('star-off.png');
expect(stars[1].src).toMatch('star-off.png');
expect(stars[2].src).toMatch('star-off.png');
expect(stars[3].src).toMatch('star-off.png');
expect(stars[4].src).toMatch('star-off.png');
});
});
});
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