mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Added several usage examples, fixed bugs, turned off restore by default
This commit is contained in:
parent
0e08b734ec
commit
416f7ab6a0
112 changed files with 23903 additions and 3348 deletions
39
libs/annotator/lib/spec/notification_spec.js
Normal file
39
libs/annotator/lib/spec/notification_spec.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
// Generated by CoffeeScript 1.6.3
|
||||
describe('Annotator.Notification', function() {
|
||||
var notification;
|
||||
notification = null;
|
||||
beforeEach(function() {
|
||||
return notification = new Annotator.Notification();
|
||||
});
|
||||
afterEach(function() {
|
||||
return notification.element.remove();
|
||||
});
|
||||
it('should be appended to the document.body', function() {
|
||||
return assert.equal(notification.element[0].parentNode, document.body);
|
||||
});
|
||||
describe('.show()', function() {
|
||||
var message;
|
||||
message = 'This is a notification message';
|
||||
beforeEach(function() {
|
||||
return notification.show(message);
|
||||
});
|
||||
it('should have a class named "annotator-notice-show"', function() {
|
||||
return assert.isTrue(notification.element.hasClass('annotator-notice-show'));
|
||||
});
|
||||
return it('should update the notification message', function() {
|
||||
return assert.equal(notification.element.html(), message);
|
||||
});
|
||||
});
|
||||
return describe('.hide()', function() {
|
||||
beforeEach(function() {
|
||||
return notification.hide();
|
||||
});
|
||||
return it('should not have a class named "show"', function() {
|
||||
return assert.isFalse(notification.element.hasClass('show'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
//@ sourceMappingURL=notification_spec.map
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue