Mailspring/spec/stores/badge-store-spec.coffee
Ben Gotow 642977126f es6(models): Remaining models => ES2016
# Conflicts:
#	src/flux/models/contact.coffee
2016-10-27 12:08:59 -07:00

19 lines
781 B
CoffeeScript

Label = require('../../src/flux/models/label').default
BadgeStore = require('../../src/flux/stores/badge-store').default
describe "BadgeStore", ->
describe "_setBadgeForCount", ->
it "should set the badge correctly", ->
spyOn(BadgeStore, '_setBadge')
BadgeStore._unread = 0
BadgeStore._setBadgeForCount()
expect(BadgeStore._setBadge).toHaveBeenCalledWith("")
BadgeStore._unread = 1
BadgeStore._setBadgeForCount()
expect(BadgeStore._setBadge).toHaveBeenCalledWith("1")
BadgeStore._unread = 100
BadgeStore._setBadgeForCount()
expect(BadgeStore._setBadge).toHaveBeenCalledWith("100")
BadgeStore._unread = 1000
BadgeStore._setBadgeForCount()
expect(BadgeStore._setBadge).toHaveBeenCalledWith("999+")