Skip to content

Commit

Permalink
Ahora pasan los tests de register
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Apr 2, 2024
1 parent 8c737de commit 7f08540
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webapp/src/components/Register/Register.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { BrowserRouter as Router } from "react-router-dom";

jest.mock("axios");

const password = process.env.REGISTER_PASSWORD || "testpassword";

describe("Register Component", () => {
const mockSuccessResponse = { data: "Usuario registrado exitosamente" };
const mockErrorResponse = { response: { data: { error: "Error al registrar usuario" } } };
Expand Down Expand Up @@ -58,7 +60,7 @@ describe("Register Component", () => {
expect(screen.getByText("Usuario registrado exitosamente")).toBeInTheDocument();
expect(axios.post).toHaveBeenCalledWith("http://localhost:8000/adduser", {
username: "testUser",
password: process.env.REGISTER_PASSWORD,
password: password
});
});

Expand All @@ -77,7 +79,7 @@ describe("Register Component", () => {
expect(screen.getByText("Error: Error al registrar usuario")).toBeInTheDocument();
expect(axios.post).toHaveBeenCalledWith("http://localhost:8000/adduser", {
username: "testUser",
password: process.env.REGISTER_PASSWORD,
password: password,
});
});
});

0 comments on commit 7f08540

Please sign in to comment.