This commit is contained in:
pro.boooooo
2024-04-01 12:55:40 +02:00
parent 61a3513ef4
commit 7402661aaa
22 changed files with 175 additions and 73 deletions

View File

@@ -28,11 +28,13 @@ describe("Login Component", () => {
target: { value: "testuser" },
});
fireEvent.change(screen.getByPlaceholderText("password"), {
target: { value: "password123" },
target: { value: "Password123!!@" },
});
expect(screen.getByPlaceholderText("username").value).toBe("testuser");
expect(screen.getByPlaceholderText("password").value).toBe("password123");
expect(screen.getByPlaceholderText("password").value).toBe(
"Password123!!@",
);
});
it("handles submit event", async () => {
@@ -40,11 +42,11 @@ describe("Login Component", () => {
target: { value: "testuser" },
});
fireEvent.change(screen.getByPlaceholderText("password"), {
target: { value: "password123" },
target: { value: "Password123!!@" },
});
fireEvent.click(screen.getByText("submit"));
expect(loginFunction).toHaveBeenCalledWith("testuser", "password123");
expect(loginFunction).toHaveBeenCalledWith("testuser", "Password123!!@");
});
//TODO add more tests please :)