tests: vault tests 3 (#2373)

This commit is contained in:
Mo
2023-07-27 07:35:38 -05:00
committed by GitHub
parent 1fef36d601
commit 14bae5e895
26 changed files with 350 additions and 283 deletions

View File

@@ -121,71 +121,4 @@ describe('migrations', () => {
await Factory.safeDeinit(application)
})
describe('2.202.1', () => {
let application
beforeEach(async () => {
application = await Factory.createAppWithRandNamespace()
await application.prepareForLaunch({
receiveChallenge: () => {},
})
await application.launch(true)
})
afterEach(async () => {
await Factory.safeDeinit(application)
})
it('remove components that are available as native features', async function () {
const editor = CreateDecryptedItemFromPayload(
new DecryptedPayload({
uuid: '123',
content_type: ContentType.TYPES.Component,
content: FillItemContent({
package_info: {
identifier: NativeFeatureIdentifier.TYPES.MarkdownProEditor,
},
}),
}),
)
await application.mutator.insertItem(editor)
await application.sync.sync()
expect(application.items.getItems(ContentType.TYPES.Component).length).to.equal(1)
/** Run migration */
const migration = new Migration2_202_1(application.migrations.services)
await migration.handleStage(ApplicationStage.FullSyncCompleted_13)
await application.sync.sync()
expect(application.items.getItems(ContentType.TYPES.Component).length).to.equal(0)
})
it('do not remove components that are available as native features but deprecated', async function () {
const editor = CreateDecryptedItemFromPayload(
new DecryptedPayload({
uuid: '123',
content_type: ContentType.TYPES.Component,
content: FillItemContent({
package_info: {
identifier: NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,
},
}),
}),
)
await application.mutator.insertItem(editor)
await application.sync.sync()
expect(application.items.getItems(ContentType.TYPES.Component).length).to.equal(1)
/** Run migration */
const migration = new Migration2_202_1(application.migrations.services)
await migration.handleStage(ApplicationStage.FullSyncCompleted_13)
await application.sync.sync()
expect(application.items.getItems(ContentType.TYPES.Component).length).to.equal(1)
})
})
})