mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
add single test for notificationServices
This commit is contained in:
28
test/spec/notificationServicesSpec.js
Normal file
28
test/spec/notificationServicesSpec.js
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
//TODO mock bootstrapGrowl, add remaining tests
|
||||
describe('notificationServices', function() {
|
||||
var notification;
|
||||
|
||||
beforeEach(module('notificationServices'));
|
||||
beforeEach(module('habitrpg'));
|
||||
|
||||
beforeEach(function() {
|
||||
module(function($provide){
|
||||
$provide.value('User', {});
|
||||
});
|
||||
|
||||
inject(function(Notification) {
|
||||
notification = Notification;
|
||||
});
|
||||
});
|
||||
|
||||
it('notifies coins amount', function() {
|
||||
var SILVER_COIN = "<i class='icon-silver'></i>";
|
||||
var GOLD_COIN = "<i class='icon-gold'></i>";
|
||||
expect(notification.coins(0.01)).to.eql("1 " + SILVER_COIN);
|
||||
expect(notification.coins(0.1)).to.eql("10 " + SILVER_COIN);
|
||||
expect(notification.coins(1)).to.eql("1 " + GOLD_COIN);
|
||||
expect(notification.coins(12.34)).to.eql("12 " + GOLD_COIN +" 33 " + SILVER_COIN);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user