mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
42 lines
1.4 KiB
CoffeeScript
42 lines
1.4 KiB
CoffeeScript
|
{Category, Label} = require 'nylas-exports'
|
||
|
|
||
|
fdescribe 'Category', ->
|
||
|
|
||
|
describe '_initCategoryTypes', ->
|
||
|
|
||
|
it 'assigns type correctly when it is a user category', ->
|
||
|
cat = new Label
|
||
|
cat.name = undefined
|
||
|
cat._initCategoryTypes()
|
||
|
expect(cat.isUserCategory()).toBe true
|
||
|
expect(cat.isStandardCategory()).toBe false
|
||
|
expect(cat.isHiddenCategory()).toBe false
|
||
|
expect(cat.isLockedCategory()).toBe false
|
||
|
|
||
|
it 'assigns type correctly when it is a standard category', ->
|
||
|
cat = new Label
|
||
|
cat.name = 'inbox'
|
||
|
cat._initCategoryTypes()
|
||
|
expect(cat.isUserCategory()).toBe false
|
||
|
expect(cat.isStandardCategory()).toBe true
|
||
|
expect(cat.isHiddenCategory()).toBe false
|
||
|
expect(cat.isLockedCategory()).toBe false
|
||
|
|
||
|
it 'assigns type correctly when it is a hidden category', ->
|
||
|
cat = new Label
|
||
|
cat.name = 'archive'
|
||
|
cat._initCategoryTypes()
|
||
|
expect(cat.isUserCategory()).toBe false
|
||
|
expect(cat.isStandardCategory()).toBe true
|
||
|
expect(cat.isHiddenCategory()).toBe true
|
||
|
expect(cat.isLockedCategory()).toBe false
|
||
|
|
||
|
it 'assigns type correctly when it is a locked category', ->
|
||
|
cat = new Label
|
||
|
cat.name = 'sent'
|
||
|
cat._initCategoryTypes()
|
||
|
expect(cat.isUserCategory()).toBe false
|
||
|
expect(cat.isStandardCategory()).toBe true
|
||
|
expect(cat.isHiddenCategory()).toBe true
|
||
|
expect(cat.isLockedCategory()).toBe false
|