mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
99c20f3b56
Fixes #516
19 lines
856 B
CoffeeScript
19 lines
856 B
CoffeeScript
Label = require '../../src/flux/models/label'
|
|
UnreadBadgeStore = require '../../src/flux/stores/unread-badge-store'
|
|
|
|
describe "UnreadBadgeStore", ->
|
|
describe "_setBadgeForCount", ->
|
|
it "should set the badge correctly", ->
|
|
spyOn(UnreadBadgeStore, '_setBadge')
|
|
UnreadBadgeStore._count = 0
|
|
UnreadBadgeStore._setBadgeForCount()
|
|
expect(UnreadBadgeStore._setBadge).toHaveBeenCalledWith("")
|
|
UnreadBadgeStore._count = 1
|
|
UnreadBadgeStore._setBadgeForCount()
|
|
expect(UnreadBadgeStore._setBadge).toHaveBeenCalledWith("1")
|
|
UnreadBadgeStore._count = 100
|
|
UnreadBadgeStore._setBadgeForCount()
|
|
expect(UnreadBadgeStore._setBadge).toHaveBeenCalledWith("100")
|
|
UnreadBadgeStore._count = 1000
|
|
UnreadBadgeStore._setBadgeForCount()
|
|
expect(UnreadBadgeStore._setBadge).toHaveBeenCalledWith("999+")
|