Skip to content

Commit

Permalink
Merge pull request #253 from codex-team/refactor/delete-test-data
Browse files Browse the repository at this point in the history
refactor(tests): delete test data
  • Loading branch information
elizachi authored May 4, 2024
2 parents f4da7b3 + 6b40b65 commit c45208e
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 634 deletions.
7 changes: 6 additions & 1 deletion src/presentation/http/router/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ describe('Auth API', () => {
test('Returns 200 when refresh token is valid and expiration date has not passed', async () => {
const refreshToken = 'pv-jIqfPj2';

/**
* Create test user
*/
const user = await global.db.insertUser();

/**
* Insert session data to the DB with tomorrow expiration date
*/
await global.db.query(`INSERT INTO public.user_sessions ("user_id", "refresh_token", "refresh_token_expires_at") VALUES (1, '${refreshToken}', CURRENT_DATE + INTERVAL '1 day')`);
await global.db.query(`INSERT INTO public.user_sessions ("user_id", "refresh_token", "refresh_token_expires_at") VALUES (${user.id}, '${refreshToken}', CURRENT_DATE + INTERVAL '1 day')`);

const response = await global.api?.fakeRequest({
method: 'POST',
Expand Down
14 changes: 0 additions & 14 deletions src/tests/test-data/note-teams.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/tests/test-data/notes-relations.json

This file was deleted.

41 changes: 0 additions & 41 deletions src/tests/test-data/notes-settings.json

This file was deleted.

Loading

0 comments on commit c45208e

Please sign in to comment.