chore: fix test (skip e2e)

This commit is contained in:
Mo
2023-08-05 15:58:52 -05:00
parent eb4a446274
commit 07c23d24f0
2 changed files with 5 additions and 10 deletions

View File

@@ -65,15 +65,10 @@ export class VaultsContext extends AppContext {
} }
/** /**
* Run a request to keep refresh token from expiring due to long bouts of inactivity for contact context * 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 * while main context changes password. Tests have a refresh token age of 10s typically, and changing password
* on CI environment may be time consuming. * on CI environment may be time consuming.
*/ */
async runAnyRequestToPreventRefreshTokenFromExpiring() {
await this.asymmetric.getInboundMessages()
}
/** Used for long running tests to avoid 498 responses */
async forceRefreshSession() { async forceRefreshSession() {
await this.application.http.refreshSession() await this.application.http.refreshSession()
} }

View File

@@ -39,19 +39,19 @@ describe('keypair change', function () {
publicKeyChain.push(context.publicKey) publicKeyChain.push(context.publicKey)
signingPublicKeyChain.push(context.signingPublicKey) signingPublicKeyChain.push(context.signingPublicKey)
await contactContext.runAnyRequestToPreventRefreshTokenFromExpiring() await contactContext.forceRefreshSession()
await context.changePassword('new_password-2') await context.changePassword('new_password-2')
publicKeyChain.push(context.publicKey) publicKeyChain.push(context.publicKey)
signingPublicKeyChain.push(context.signingPublicKey) signingPublicKeyChain.push(context.signingPublicKey)
await contactContext.runAnyRequestToPreventRefreshTokenFromExpiring() await contactContext.forceRefreshSession()
await context.changePassword('new_password-3') await context.changePassword('new_password-3')
publicKeyChain.push(context.publicKey) publicKeyChain.push(context.publicKey)
signingPublicKeyChain.push(context.signingPublicKey) signingPublicKeyChain.push(context.signingPublicKey)
await contactContext.runAnyRequestToPreventRefreshTokenFromExpiring() await contactContext.forceRefreshSession()
await context.changeNoteTitleAndSync(note, 'new title') await context.changeNoteTitleAndSync(note, 'new title')
@@ -74,7 +74,7 @@ describe('keypair change', function () {
expect(receivedNote.signatureData.result.passes).to.be.true expect(receivedNote.signatureData.result.passes).to.be.true
await deinitContactContext() await deinitContactContext()
}).timeout(Factory.ThirtySecondTimeout) }).timeout(Factory.SixtySecondTimeout)
it('should not trust messages sent with previous key pair', async () => { it('should not trust messages sent with previous key pair', async () => {
const { sharedVault, contactContext, deinitContactContext } = const { sharedVault, contactContext, deinitContactContext } =