Skip to content

Commit

Permalink
Delete test user after some test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Sep 6, 2023
1 parent 89c5c9e commit a357abf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/authorizationService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function authorizationHandlerTestCases() {
const accessToken = await generateTestAccessToken(user.id);
const jwtUser = await authorizationHandler('1', accessToken);
assert.equal(jwtUser.userId, user.id);
await User.delete(user.id);
});
it('should decode user jwt with the auth microservice', async () => {
const privateKey = process.env.PRIVATE_ETHERS_TEST_KEY as string;
Expand Down Expand Up @@ -73,6 +74,7 @@ function authorizationHandlerTestCases() {
const accessToken = authenticationResult.data.jwt;
const jwtUser = await authorizationHandler('2', accessToken);
assert.equal(jwtUser.userId, user.id);
await User.delete(user.id);
});
it('should decode jwt and create user if it is nonexistent', async () => {
const privateKey = process.env.PRIVATE_ETHERS_SECONDARY_TEST_KEY as string;
Expand Down Expand Up @@ -109,5 +111,7 @@ function authorizationHandlerTestCases() {
const user = await findUserByWalletAddress(publicKey);
assert.equal(jwtUser.userId, user!.id);
assert.equal(user!.walletAddress, publicKey.toLowerCase());

await User.delete(user!.id);
});
}

0 comments on commit a357abf

Please sign in to comment.