internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-unused-expressions */
/* eslint-disable no-undef */
import { BaseItemCounts } from '../lib/Applications.js'
import { BaseItemCounts } from '../lib/BaseItemCounts.js'
import * as Factory from '../lib/factory.js'
chai.use(chaiAsPromised)
const expect = chai.expect
@@ -31,6 +31,21 @@ describe('offline syncing', () => {
localStorage.clear()
})
it('uuid alternation should delete original payload', async function () {
const note = await Factory.createMappedNote(this.application)
this.expectedItemCount++
await Factory.alternateUuidForItem(this.application, note.uuid)
await this.application.sync.sync(syncOptions)
const notes = this.application.itemManager.getDisplayableNotes()
expect(notes.length).to.equal(1)
expect(notes[0].uuid).to.not.equal(note.uuid)
const items = this.application.itemManager.allTrackedItems()
expect(items.length).to.equal(this.expectedItemCount)
})
it('should sync item with no passcode', async function () {
let note = await Factory.createMappedNote(this.application)
expect(Uuids(this.application.itemManager.getDirtyItems()).includes(note.uuid))