Skip to content

Commit

Permalink
Correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefifm committed Jun 1, 2023
1 parent 0e6f8b8 commit e08a1c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions test/equipos.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const equipoAlta = {
};

const equipoModificacion = {
IdEquipoF1: 13,
IdEquipoF1: 11,
NombreEquipo: "Equipo " + (() => (Math.random() + 1).toString(36).substring(2))()
};

Expand Down Expand Up @@ -54,15 +54,15 @@ describe("POST /api/equipos", () => {
});

describe("PUT /api/equipos", () => {
it("Debería devolver el equipo con el id 13 modificado", async () => {
const res = await request(app).put("/api/equipos/13").send(equipoModificacion);
it("Debería devolver el equipo con el id 11 modificado", async () => {
const res = await request(app).put("/api/equipos/11").send(equipoModificacion);
expect(res.statusCode).toEqual(200);
});
});

describe("DELETE /api/equipos", () => {
it("Debería devolver el equipo con el id 12 eliminado", async () => {
const res = await request(app).delete("/api/equipos/13");
it("Debería devolver el equipo con el id 11 eliminado", async () => {
const res = await request(app).delete("/api/equipos/11");
expect(res.statusCode).toEqual(200);
});
});
10 changes: 5 additions & 5 deletions test/pilotos.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const pilotoAlta = {
};

const pilotoModificacion = {
IdPiloto: 13,
IdPiloto: 11,
NombrePiloto: "Piloto " + (() => (Math.random() + 1).toString(36).substring(2))(),
FechaNacimiento: new Date().toISOString(),
IdEquipoF1: 2,
Expand Down Expand Up @@ -70,15 +70,15 @@ describe("POST /api/pilotos", () => {
});

describe("PUT /api/pilotos/:id", () => {
it("Debería devolver el piloto con el id 13 modificado", async () => {
const res = await request(app).put("/api/pilotos/13").send(pilotoModificacion);
it("Debería devolver el piloto con el id 11 modificado", async () => {
const res = await request(app).put("/api/pilotos/11").send(pilotoModificacion);
expect(res.statusCode).toEqual(200);
});
});

describe("DELETE /api/pilotos/:id", () => {
it("Debería devolver el piloto con el id 13 eliminado", async () => {
const res = await request(app).delete("/api/pilotos/13");
it("Debería devolver el piloto con el id 11 eliminado", async () => {
const res = await request(app).delete("/api/pilotos/11");
expect(res.statusCode).toEqual(200);
});
});

0 comments on commit e08a1c0

Please sign in to comment.