fix(web): archived and deleted counts on encryption panel (#1423)

* fix(web): archived and deleted counts on encryption panel

* fix(snjs): yarn build snjs before e2e test suite docker builds
This commit is contained in:
Karol Sójko
2022-08-23 11:38:43 +02:00
committed by GitHub
parent a780fa4e87
commit 2bdd931f6d
9 changed files with 106 additions and 31 deletions

View File

@@ -0,0 +1,31 @@
import { ContentType } from '@standardnotes/common'
import { SNNote, SNTag } from '@standardnotes/models'
import { ItemCounter } from './ItemCounter'
describe('ItemCounter', () => {
const createCounter = () => new ItemCounter()
it('should count distinct item counts', () => {
const items = [
{
archived: true,
} as jest.Mocked<SNNote>,
{
trashed: true,
} as jest.Mocked<SNNote>,
{
content_type: ContentType.Note,
} as jest.Mocked<SNNote>,
{
content_type: ContentType.Tag,
} as jest.Mocked<SNTag>,
]
expect(createCounter().countNotesAndTags(items)).toEqual({
archived: 1,
deleted: 1,
notes: 1,
tags: 1,
})
})
})