-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix e2e tests * cleanup * Add github action * yarn install before start db * test seperate postgres service * Increase timeouts * play with postgres service variables * Remove E2E test from workflow * update PR template * uncomment check for env * Remove timers
- Loading branch information
1 parent
e377149
commit eb61b74
Showing
20 changed files
with
125 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ export class TokenExpiredError extends Error { | |
constructor() { | ||
super(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { Student } from "src/student/entities/student.entity"; | ||
|
||
/** | ||
* Represents an authenticated request using the JwtAuthGuard. | ||
*/ | ||
/** Represents an authenticated request using the JwtAuthGuard. */ | ||
export interface AuthenticatedRequest extends Request { | ||
user: Student; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ export class EmailNotConfirmed extends Error { | |
constructor() { | ||
super(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ describe("AuthController (e2e)", () => { | |
let app: INestApplication; | ||
let connection: Connection; | ||
|
||
beforeEach(async () => { | ||
beforeAll(async () => { | ||
app = await initializeApp(); | ||
connection = app.get(Connection); | ||
|
||
|
@@ -30,7 +30,8 @@ describe("AuthController (e2e)", () => { | |
.post("/auth/register") | ||
.send({ | ||
email: "[email protected]", | ||
password: "1234567890", | ||
password: "1234567890a", | ||
passwordConfirm: "1234567890a", | ||
}) | ||
.expect(201); | ||
|
||
|
@@ -50,13 +51,23 @@ describe("AuthController (e2e)", () => { | |
.into(Student) | ||
.values([{ ...testUser1 }]); | ||
|
||
await request(app.getHttpServer()) | ||
.post("/auth/register") | ||
.send(testUser1) | ||
.expect(201); | ||
|
||
await request(app.getHttpServer()) | ||
.post("/auth/register") | ||
.send(testUser1) | ||
.expect(400); | ||
}); | ||
|
||
it("logs in with valid credentials", async () => { | ||
await request(app.getHttpServer()) | ||
.post("/auth/register") | ||
.send(testUser1) | ||
.expect(201); | ||
|
||
const res = await request(app.getHttpServer()) | ||
.post("/auth/login") | ||
.send(testUser1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.