Files
habitica/test/spec/notificationServicesSpec.js
Sean Zellmer 4bc4e836e4 Make karma tests pass.
This pends a lot of tests that are failing due to translations not being loaded in the environment, as well as some issues with the page reload in groupServicesSpec.

We removed the module declarations for habitrpg in each spec since that
has been moved to specHelper.
2015-03-07 15:48:23 -06:00

26 lines
796 B
JavaScript

'use strict';
//TODO mock bootstrapGrowl, add remaining tests
describe('notificationServices', function() {
var notification;
beforeEach(function() {
module(function($provide){
$provide.value('User', {});
});
inject(function(Notification) {
notification = Notification;
});
});
it('notifies coins amount', function() {
var SILVER_COIN = "<span class='notification-icon shop_silver'></span>";
var GOLD_COIN = "<span class='notification-icon shop_gold'></span>";
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);
});
});