Skip to content

Commit

Permalink
Fallos de seguridad arreglados
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Apr 7, 2024
1 parent 5262bbe commit 381f23e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions users/userservice/user-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { User } = require("./user-model");
let mongoServer;
let app;

const password = "testpassword";

beforeAll(async () => {
mongoServer = await MongoMemoryServer.create();
const mongoUri = mongoServer.getUri();
Expand All @@ -21,7 +23,7 @@ describe("User Service", () => {
it("should add a new user on POST /adduser", async () => {
const newUser = {
username: "testuser",
password: "testpassword",
password: password,
};

const response = await request(app).post("/adduser").send(newUser);
Expand All @@ -44,7 +46,7 @@ describe("User Service", () => {
it("should add a new user on POST /adduser", async () => {
const newUser = {
username: "testuser",
password: "testpassword",
password: password,
};

await request(app).post("/adduser").send(newUser);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Register/Register.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe("Register Component", () => {
).toBeInTheDocument();
expect(axios.post).toHaveBeenCalledWith(`${apiEndpoint}/adduser`, {
username: "testUser",
password: "testPassword",
password: password,
});
});

Expand All @@ -101,7 +101,7 @@ describe("Register Component", () => {
).toBeInTheDocument();
expect(axios.post).toHaveBeenCalledWith(`${apiEndpoint}/adduser`, {
username: "testUser",
password: "testPassword",
password: password,
});
});

Expand Down

0 comments on commit 381f23e

Please sign in to comment.