mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
20 lines
763 B
CoffeeScript
20 lines
763 B
CoffeeScript
|
Label = require '../../src/flux/models/label'
|
||
|
BadgeStore = require '../../src/flux/stores/badge-store'
|
||
|
|
||
|
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+")
|