chore: fix test

This commit is contained in:
Mo
2023-08-05 14:24:57 -05:00
parent d8d4052a52
commit eb4a446274
2 changed files with 26 additions and 3 deletions

View File

@@ -49,6 +49,21 @@ export class VaultsContext extends AppContext {
await this.awaitPromiseOrThrow(promise, undefined, 'Waiting for invites to process')
}
async syncAndAwaitInviteAndMessageProcessing() {
const invitePromise = this.resolveWhenAsyncFunctionCompletes(this.vaultInvites, 'processInboundInvites')
const messagePromise = this.resolveWhenAsyncFunctionCompletes(
this.asymmetric,
'handleRemoteReceivedAsymmetricMessages',
)
await this.sync()
await Promise.all([
this.awaitPromiseOrThrow(invitePromise, undefined, 'Waiting for invites to process'),
this.awaitPromiseOrThrow(messagePromise, undefined, 'Waiting for messages to process'),
])
}
/**
* Run a request to keep refresh token from expiring due to long bouts of inactivity for contact context
* while main context changes password. Tests have a refresh token age of 10s typically, and changing password
@@ -58,6 +73,11 @@ export class VaultsContext extends AppContext {
await this.asymmetric.getInboundMessages()
}
/** Used for long running tests to avoid 498 responses */
async forceRefreshSession() {
await this.application.http.refreshSession()
}
async createSharedPasswordVault(password) {
const privateVault = await this.vaults.createUserInputtedPasswordVault({
name: 'Our Vault',