From c48e57b987ed5087308e22baea4828375e0a90ee Mon Sep 17 00:00:00 2001 From: Eduardo de Valle Date: Fri, 14 Jun 2024 20:52:36 -0600 Subject: [PATCH 1/7] E2E testing added from Eduardo de Valle to sprintSurvey.cy.ts --- cypress/e2e/sprintSurvey.cy.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cypress/e2e/sprintSurvey.cy.ts b/cypress/e2e/sprintSurvey.cy.ts index c7ef634..5de858f 100644 --- a/cypress/e2e/sprintSurvey.cy.ts +++ b/cypress/e2e/sprintSurvey.cy.ts @@ -10,4 +10,15 @@ describe("Sprint Survey", () => { cy.get('[data-testid="Sprint Survey"]').click(); cy.get('[data-testid="sprint-survey"]').should("exist"); }); + + // José Eduardo de Valle Lara A01734957 + it("Not allow to move forward if not done with step two", () => { + cy.get("button").contains("Next").click(); + cy.get('[data-testid="sprint-step-two"]').should("exist"); + cy.wait(3000); + cy.get("button").contains("Submit").click(); + cy.get("div") + .contains("Please fill all the fields before submitting the survey") + .should("exist"); + }); }); From e8fdd715fc6ed9551dcac371fe51f8b0807e0258 Mon Sep 17 00:00:00 2001 From: AlexMendozaPrado Date: Fri, 14 Jun 2024 22:04:45 -0600 Subject: [PATCH 2/7] Prueba de Cypress Alejandro Mendoza Prado --- cypress/e2e/sprintSurvey.cy.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/sprintSurvey.cy.ts b/cypress/e2e/sprintSurvey.cy.ts index 5de858f..1efcee3 100644 --- a/cypress/e2e/sprintSurvey.cy.ts +++ b/cypress/e2e/sprintSurvey.cy.ts @@ -4,12 +4,22 @@ describe("Sprint Survey", () => { cy.get("label").contains("Email").click().type("cypress@outlook.com"); cy.get("label").contains("Password").click().type("cypress"); cy.get("button").contains("Log in").click(); - cy.wait(12000); + cy.wait(15000); cy.url().should("include", "/dashboard"); cy.get('[data-testid="notification-button"]').click(); cy.get('[data-testid="Sprint Survey"]').click(); cy.get('[data-testid="sprint-survey"]').should("exist"); }); + //Alejandro Mendoza Prado A00819383 + it("Fill step one", () => { + cy.get('[data-testid="sprint-step-one"]').should("exist"); + const sliders = cy.get('[data-testid^="slider-"]'); + sliders.each((slider) => { + cy.wrap(slider).find("input").invoke("val", 1).trigger("change"); + }); + cy.get("button").contains("Next").click(); + cy.get('[data-testid="sprint-step-two"]').should("exist"); + }); // José Eduardo de Valle Lara A01734957 it("Not allow to move forward if not done with step two", () => { From d7b9e78f19bf8c1ace0fa03adf2b6845a5a87892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Fri, 14 Jun 2024 22:22:54 -0600 Subject: [PATCH 3/7] changed pre commit file --- .husky/pre-commit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 19af96b..7e1eb6b 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,3 @@ -# npm run tsc -# npm run lint:fix -# npm run test +npm run tsc +npm run lint:fix +npm run test:ci From 3e9ae43e72c065cd7d30b0143299686a44ab39d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Fri, 14 Jun 2024 22:41:50 -0600 Subject: [PATCH 4/7] data for cypress --- app/(base)/pcp/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/(base)/pcp/page.tsx b/app/(base)/pcp/page.tsx index 40365e2..f9659c4 100644 --- a/app/(base)/pcp/page.tsx +++ b/app/(base)/pcp/page.tsx @@ -295,7 +295,7 @@ const PCPTasks = ({ {tasksLoading ? ( -

loading...

+

loading..

) : tasksData && typeof tasksData === "string" ? ( ) : ( From ebbbe6ab829798efa530d2cbd8619cd5cab4b776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Fri, 14 Jun 2024 22:44:03 -0600 Subject: [PATCH 5/7] changed husky file --- .husky/pre-commit | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 7e1eb6b..4a40d2f 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1 @@ -npm run tsc -npm run lint:fix -npm run test:ci +npm run tsc && npm run lint:fix && npm run test:ci From ff21f005b1beb2299bef8c663ffc54910fc8a0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Fri, 14 Jun 2024 22:57:43 -0600 Subject: [PATCH 6/7] changed cypress --- cypress/e2e/signin.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/signin.cy.ts b/cypress/e2e/signin.cy.ts index ee9aea1..5a3c0ed 100644 --- a/cypress/e2e/signin.cy.ts +++ b/cypress/e2e/signin.cy.ts @@ -14,7 +14,7 @@ describe("Register", () => { cy.get("button").contains("Register").click(); cy.wait(2000); cy.get("div").contains("Account created successfully.").should("exist"); - cy.wait(60000); + cy.wait(61000); cy.url().should("include", "/dashboard"); cy.visit("/profile"); cy.wait(30000); From a70ff852eae1b3e8f104babba74a18c212cabe8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20S=C3=A1nchez?= Date: Fri, 14 Jun 2024 23:07:05 -0600 Subject: [PATCH 7/7] puse mal mi matricula en las pruebas, no me odien --- test/FormTextInput.test.tsx | 10 +++++----- test/ProjectCard.test.tsx | 6 +++--- test/Searchbar.test.tsx | 2 +- test/services/notifications.test.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/FormTextInput.test.tsx b/test/FormTextInput.test.tsx index c2543fa..66e54d6 100644 --- a/test/FormTextInput.test.tsx +++ b/test/FormTextInput.test.tsx @@ -56,31 +56,31 @@ describe("FormTextInput Component", () => { }); describe("FormTextInput Component Test", () => { - // José Carlos Sánchez Gómez A01745810 - Test #1/10 + // José Carlos Sánchez Gómez A01174050 - Test #1/10 it("Should render input", () => { render(); expect(screen.getByTestId("name")).toBeInTheDocument(); }); - // José Carlos Sánchez Gómez A01745810 - Test #2/10 + // José Carlos Sánchez Gómez A01174050 - Test #2/10 it("Should render label", () => { render(); expect(screen.getByText("Name")).toBeInTheDocument(); }); - // José Carlos Sánchez Gómez A01745810 - Test #3/10 + // José Carlos Sánchez Gómez A01174050 - Test #3/10 it("Should render password input", () => { render(); expect(screen.getByTestId("password")).toBeInTheDocument(); }); - // José Carlos Sánchez Gómez A01745810 - Test #4/10 + // José Carlos Sánchez Gómez A01174050 - Test #4/10 it("Should render password label", () => { render(); expect(screen.getByText("Password")).toBeInTheDocument(); }); - // José Carlos Sánchez Gómez A01745810 - Test #5/10 + // José Carlos Sánchez Gómez A01174050 - Test #5/10 it("Should toggle password input", () => { render(); expect(screen.getByText("Show")).toBeInTheDocument(); diff --git a/test/ProjectCard.test.tsx b/test/ProjectCard.test.tsx index c390f77..ad7386e 100644 --- a/test/ProjectCard.test.tsx +++ b/test/ProjectCard.test.tsx @@ -26,7 +26,7 @@ vi.mock("@/services/project", () => { }); describe("ProjectCard Component Test", () => { - // José Carlos Sánchez Gómez A01745810 - Test #7/10 + // José Carlos Sánchez Gómez A01174050 - Test #7/10 it("Should render the project card", async () => { const component = await ProjectCard({ id: 1, @@ -40,7 +40,7 @@ describe("ProjectCard Component Test", () => { expect(projectCard).toBeInTheDocument(); }); - // José Carlos Sánchez Gómez A01745810 - Test #8/10 + // José Carlos Sánchez Gómez A01174050 - Test #8/10 it("Should render all the coworkers", async () => { const component = await ProjectCard({ id: 1, @@ -56,7 +56,7 @@ describe("ProjectCard Component Test", () => { }); }); - // José Carlos Sánchez Gómez A01745810 - Test #9/10 + // José Carlos Sánchez Gómez A01174050 - Test #9/10 it("Should render all the properties", async () => { const component = await ProjectCard({ id: 1, diff --git a/test/Searchbar.test.tsx b/test/Searchbar.test.tsx index d1b6952..2ced000 100644 --- a/test/Searchbar.test.tsx +++ b/test/Searchbar.test.tsx @@ -3,7 +3,7 @@ import { render } from "@testing-library/react"; import { describe, it } from "vitest"; describe("Searchbar Component Test", () => { - // José Carlos Sánchez Gómez A01745810 - Test #10/10 + // José Carlos Sánchez Gómez A01174050 - Test #10/10 it("Should be rendered on the screen", () => { render(); }); diff --git a/test/services/notifications.test.ts b/test/services/notifications.test.ts index a4941b7..97e3a39 100644 --- a/test/services/notifications.test.ts +++ b/test/services/notifications.test.ts @@ -56,7 +56,7 @@ vi.mock("drizzle-orm", () => ({ isNull: vi.fn(), })); -// José Carlos Sánchez Gómez A01745810 - Test #6/10 +// José Carlos Sánchez Gómez A01174050 - Test #6/10 describe("getNotifications", () => { it("should return notifications", async () => { const notifications = await getNotifications();