UNPKG

raty-js

Version:

Raty - A Star Rating Plugin

36 lines (26 loc) 796 B
describe('#cancelOff', function() { beforeEach(function() { $.raty.path = '../lib/images'; }); afterEach(function() { Helper.clear(); }); it ('changes the icon', function() { // given this.el = Helper.create('#el'); // when this.el.raty({ cancelButton: true, cancelOff: 'star-half.png' }); // then var cancel = this.el.children('.raty-cancel'); expect(cancel).toHaveAttr('src', '../lib/images/star-half.png'); }); it ('accepts data attribute', function() { // given this.el = Helper._append('div', { 'data-cancel-off': 'custom.png' }); // when this.el.raty({ cancelButton: true }); // then var cancel = this.el.children('.raty-cancel'); expect(cancel).toHaveAttr('src', '../lib/images/custom.png'); }); });