Skip to content

Commit

Permalink
🧪 chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rezk2ll committed Jul 12, 2024
1 parent 51a899a commit 1889bbb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/tom-server/src/vault-api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('Vault API server', () => {
.set('Authorization', `Bearer ${accessToken}`)
expect(response.statusCode).toBe(201)
expect(response.body).toStrictEqual({
message: 'Saved recovery words sucessfully'
message: 'Saved recovery words successfully'
})
})

Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Vault API server', () => {
.set('Authorization', `Bearer ${unsavedToken}`)
expect(response.statusCode).toBe(201)
expect(response.body).toStrictEqual({
message: 'Saved recovery words sucessfully'
message: 'Saved recovery words successfully'
})
await removeUserInAccessTokenTable(unsavedToken)
await removeUserInRecoveryWordsTable(matrixServerResponseBody.user_id)
Expand Down Expand Up @@ -236,6 +236,18 @@ describe('Vault API server', () => {
})
})

it('should update words in the dabase if the connected user have some', async () => {
const response = await request(app)
.put(endpoint)
.send({ words })
.set('Authorization', `Bearer ${accessToken}`)

expect(response.statusCode).toBe(200)
expect(response.body).toStrictEqual({
message: 'Updated recovery words successfully'
})
})

it('should reject if more than 100 requests are done in less than 10 seconds on get words', async () => {
let response
let token
Expand Down

0 comments on commit 1889bbb

Please sign in to comment.