We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afb8bea commit c2cca10Copy full SHA for c2cca10
packages/api/test/e2e/auth.test.ts
@@ -14,3 +14,20 @@ afterEach(async () => {
14
afterAll(async () => {
15
await mongoose.connection.close();
16
});
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
+ email: "[email protected]",
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