From 2fc775c21ce1313d5d9ddf0a567cd2069841dbca Mon Sep 17 00:00:00 2001 From: Ilya Lyudevig Date: Fri, 25 Oct 2024 14:49:24 +0300 Subject: [PATCH 1/2] Add link to the project issues --- features/projects/components/project-card/project-card.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/features/projects/components/project-card/project-card.tsx b/features/projects/components/project-card/project-card.tsx index 7188e30..4b173dc 100644 --- a/features/projects/components/project-card/project-card.tsx +++ b/features/projects/components/project-card/project-card.tsx @@ -63,7 +63,10 @@ export function ProjectCard({ project }: ProjectCardProps) {
- + View issues
From b649f6469bde8d8551ac47241c9cb90c8545d91d Mon Sep 17 00:00:00 2001 From: Ilya Lyudevig Date: Fri, 25 Oct 2024 15:40:13 +0300 Subject: [PATCH 2/2] Add View issues links test --- cypress/e2e/project-list.cy.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/project-list.cy.ts b/cypress/e2e/project-list.cy.ts index fdba7b3..d056df4 100644 --- a/cypress/e2e/project-list.cy.ts +++ b/cypress/e2e/project-list.cy.ts @@ -1,4 +1,3 @@ -import capitalize from "lodash/capitalize"; import mockProjects from "../fixtures/projects.json"; describe("Project List", () => { @@ -41,7 +40,6 @@ describe("Project List", () => { }); it("renders the projects", () => { - const languageNames = ["React", "Node.js", "Python"]; const statusNames = ["Critical", "Warning", "Stable"]; // get all project cards @@ -50,13 +48,21 @@ describe("Project List", () => { .each(($el, index) => { // check that project data is rendered cy.wrap($el).contains(mockProjects[index].name); - cy.wrap($el).contains(languageNames[index]); + cy.wrap($el).contains(mockProjects[index].language, { + matchCase: false, + }); cy.wrap($el).contains(mockProjects[index].numIssues); cy.wrap($el).contains(mockProjects[index].numEvents24h); - cy.wrap($el).contains(capitalize(statusNames[index])); + cy.wrap($el).contains(statusNames[index]); cy.wrap($el) .find("a") - .should("have.attr", "href", "/dashboard/issues"); + .should("have.attr", "href") + .and( + "contains", + "/dashboard/issues?project=".concat( + mockProjects[index].name.match(/^[^\s]+/)?.[0] as string, + ), + ); }); }); });