$
This commit is contained in:
@@ -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 :)
|
||||
|
Reference in New Issue
Block a user