diff --git a/test/spec/notificationServicesSpec.js b/test/spec/notificationServicesSpec.js new file mode 100644 index 0000000000..06d409d6a4 --- /dev/null +++ b/test/spec/notificationServicesSpec.js @@ -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 = ""; + var GOLD_COIN = ""; + 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); + }); +}); \ No newline at end of file