Skip to content

Commit c2cca10

Browse files
committed
fixing ci /cd
1 parent afb8bea commit c2cca10

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/api/test/e2e/auth.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,20 @@ afterEach(async () => {
1414
afterAll(async () => {
1515
await mongoose.connection.close();
1616
});
17+
18+
describe("Tests for password encryption and validation", () => {
19+
it("should not store raw passwords in the database", async () => {
20+
const password = "testcase1";
21+
const userInfo = {
22+
23+
password,
24+
};
25+
await request(app).post("/auth/signup").send(userInfo).expect(201);
26+
27+
const user = await User.findOne({ email: userInfo.email });
28+
expect(user).not.toBeNull();
29+
expect(user?.password).toBeDefined();
30+
expect(user?.password).not.toEqual(password);
31+
expect(user?.verifyPassword(password)).resolves.toBeTruthy();
32+
});
33+
});

0 commit comments

Comments
 (0)