refactor: application dependency management (#2363)

This commit is contained in:
Mo
2023-07-23 15:54:31 -05:00
committed by GitHub
parent e698b1c990
commit a77535456c
299 changed files with 7415 additions and 4890 deletions

View File

@@ -12,7 +12,6 @@ describe('files', function () {
let context
let fileService
let itemManager
let subscriptionId = 1001
beforeEach(function () {
localStorage.clear()
@@ -28,8 +27,8 @@ describe('files', function () {
await context.launch()
application = context.application
fileService = context.application.fileService
itemManager = context.application.itemManager
fileService = context.application.files
itemManager = context.application.items
await Factory.registerUserToApplication({
application: context.application,
@@ -51,7 +50,7 @@ describe('files', function () {
await setup({ fakeCrypto: true, subscription: true })
const remoteIdentifier = Utils.generateUuid()
const token = await application.apiService.createUserFileValetToken(remoteIdentifier, ValetTokenOperation.Write)
const token = await application.legacyApi.createUserFileValetToken(remoteIdentifier, ValetTokenOperation.Write)
expect(token.length).to.be.above(0)
})
@@ -60,7 +59,7 @@ describe('files', function () {
await setup({ fakeCrypto: true, subscription: false })
const remoteIdentifier = Utils.generateUuid()
const tokenOrError = await application.apiService.createUserFileValetToken(
const tokenOrError = await application.legacyApi.createUserFileValetToken(
remoteIdentifier,
ValetTokenOperation.Write,
)
@@ -79,7 +78,7 @@ describe('files', function () {
})
const remoteIdentifier = Utils.generateUuid()
const tokenOrError = await application.apiService.createUserFileValetToken(
const tokenOrError = await application.legacyApi.createUserFileValetToken(
remoteIdentifier,
ValetTokenOperation.Write,
)
@@ -90,19 +89,19 @@ describe('files', function () {
it('creating two upload sessions successively should succeed', async function () {
await setup({ fakeCrypto: true, subscription: true })
const firstToken = await application.apiService.createUserFileValetToken(
const firstToken = await application.legacyApi.createUserFileValetToken(
Utils.generateUuid(),
ValetTokenOperation.Write,
)
const firstSession = await application.apiService.startUploadSession(firstToken, 'user')
const firstSession = await application.legacyApi.startUploadSession(firstToken, 'user')
expect(firstSession.uploadId).to.be.ok
const secondToken = await application.apiService.createUserFileValetToken(
const secondToken = await application.legacyApi.createUserFileValetToken(
Utils.generateUuid(),
ValetTokenOperation.Write,
)
const secondSession = await application.apiService.startUploadSession(secondToken, 'user')
const secondSession = await application.legacyApi.startUploadSession(secondToken, 'user')
expect(secondSession.uploadId).to.be.ok
})