Skip to content

Commit

Permalink
Merge pull request #243 from wizelineacademy/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JoseCSG authored Jun 15, 2024
2 parents abda22f + a70ff85 commit c070c9f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 16 deletions.
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# npm run tsc
# npm run lint:fix
# npm run test
npm run tsc && npm run lint:fix && npm run test:ci
2 changes: 1 addition & 1 deletion app/(base)/pcp/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const PCPTasks = ({
</div>

{tasksLoading ? (
<p>loading...</p>
<p>loading..</p>
) : tasksData && typeof tasksData === "string" ? (
<NoDataCard text={tasksData} />
) : (
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/signin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 22 additions & 1 deletion cypress/e2e/sprintSurvey.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,31 @@ describe("Sprint Survey", () => {
cy.get("label").contains("Email").click().type("[email protected]");
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", () => {
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");
});
});
10 changes: 5 additions & 5 deletions test/FormTextInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<FormTextInput name="name" type="text" label="Name" />);
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(<FormTextInput name="name" type="text" label="Name" />);
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(<FormTextInput name="password" type="password" label="Password" />);
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(<FormTextInput name="password" type="password" label="Password" />);
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(<FormTextInput name="password" type="password" label="Password" />);
expect(screen.getByText("Show")).toBeInTheDocument();
Expand Down
6 changes: 3 additions & 3 deletions test/ProjectCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/Searchbar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<SearchBar placeholder="Prueba" />);
});
Expand Down
2 changes: 1 addition & 1 deletion test/services/notifications.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c070c9f

Please sign in to comment.