From 73f0d96da0e46add70c968d1afd8080e27193e08 Mon Sep 17 00:00:00 2001 From: Amanda Anderson Date: Wed, 4 Dec 2024 16:35:34 +0100 Subject: [PATCH 1/5] Fix failing e2e --- front/cypress/e2e/idea_cards.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/cypress/e2e/idea_cards.cy.ts b/front/cypress/e2e/idea_cards.cy.ts index 2981ec5bdb07..25641152404a 100644 --- a/front/cypress/e2e/idea_cards.cy.ts +++ b/front/cypress/e2e/idea_cards.cy.ts @@ -70,7 +70,7 @@ describe('Idea cards without filter sidebar sorting and filtering', () => { }); it('lets you filter the ideas by topic', () => { - cy.contains('waste').click(); + cy.contains('waste').last().click(); cy.get('#e2e-ideas-container') .find('.e2e-idea-card') .should('have.length', 1) From 67570863715a7c73c2af47920f0589063ca1b583 Mon Sep 17 00:00:00 2001 From: Amanda Anderson Date: Wed, 4 Dec 2024 17:21:42 +0100 Subject: [PATCH 2/5] Fix test --- front/cypress/e2e/idea_cards.cy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/front/cypress/e2e/idea_cards.cy.ts b/front/cypress/e2e/idea_cards.cy.ts index 25641152404a..e1ac731f9f1f 100644 --- a/front/cypress/e2e/idea_cards.cy.ts +++ b/front/cypress/e2e/idea_cards.cy.ts @@ -70,6 +70,7 @@ describe('Idea cards without filter sidebar sorting and filtering', () => { }); it('lets you filter the ideas by topic', () => { + cy.contains('Show all').click(); cy.contains('waste').last().click(); cy.get('#e2e-ideas-container') .find('.e2e-idea-card') From c50ce23d46eabf06f7df4f1b19914c490d407e4e Mon Sep 17 00:00:00 2001 From: Amanda Anderson Date: Wed, 4 Dec 2024 18:03:36 +0100 Subject: [PATCH 3/5] Fix e2e --- front/app/components/FilterBoxes/TopicsFilter.tsx | 7 ++++++- front/cypress/e2e/idea_cards.cy.ts | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/front/app/components/FilterBoxes/TopicsFilter.tsx b/front/app/components/FilterBoxes/TopicsFilter.tsx index 6a3b0bc7b14b..52ed2017fcd9 100644 --- a/front/app/components/FilterBoxes/TopicsFilter.tsx +++ b/front/app/components/FilterBoxes/TopicsFilter.tsx @@ -134,7 +134,11 @@ const TopicsFilter = memo( ) : ( - + {topicsWithIdeas .slice(0, showFullList ? undefined : 5) // We show only 5 topics by default with a "Show all" button. .map((topic: ITopicData) => { @@ -176,6 +180,7 @@ const TopicsFilter = memo( p="0px" mt="12px" fontSize="s" + id="e2e-show-all-tags-button" > {formatMessage( showFullList diff --git a/front/cypress/e2e/idea_cards.cy.ts b/front/cypress/e2e/idea_cards.cy.ts index e1ac731f9f1f..fa419fe9b41a 100644 --- a/front/cypress/e2e/idea_cards.cy.ts +++ b/front/cypress/e2e/idea_cards.cy.ts @@ -70,8 +70,13 @@ describe('Idea cards without filter sidebar sorting and filtering', () => { }); it('lets you filter the ideas by topic', () => { - cy.contains('Show all').click(); - cy.contains('waste').last().click(); + cy.get('#e2e-show-all-tags-button').scrollIntoView(); + cy.get('#e2e-show-all-tags-button').click(); + + cy.get('#e2e-topics-filters').within(() => { + cy.contains('waste').click(); + }); + cy.get('#e2e-ideas-container') .find('.e2e-idea-card') .should('have.length', 1) From 28de38b73f52d4d221faa60ed0f7ce8b705a0bdb Mon Sep 17 00:00:00 2001 From: Amanda Anderson Date: Fri, 6 Dec 2024 10:08:12 +0100 Subject: [PATCH 4/5] Try to fix failing test --- front/cypress/e2e/idea_cards.cy.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/front/cypress/e2e/idea_cards.cy.ts b/front/cypress/e2e/idea_cards.cy.ts index fa419fe9b41a..ecafd01988bc 100644 --- a/front/cypress/e2e/idea_cards.cy.ts +++ b/front/cypress/e2e/idea_cards.cy.ts @@ -70,9 +70,6 @@ describe('Idea cards without filter sidebar sorting and filtering', () => { }); it('lets you filter the ideas by topic', () => { - cy.get('#e2e-show-all-tags-button').scrollIntoView(); - cy.get('#e2e-show-all-tags-button').click(); - cy.get('#e2e-topics-filters').within(() => { cy.contains('waste').click(); }); From aea0a0226e12e7437bb327b2da360761ebc6cb5c Mon Sep 17 00:00:00 2001 From: Amanda Anderson Date: Fri, 6 Dec 2024 10:37:50 +0100 Subject: [PATCH 5/5] Remove unnecessary code --- front/app/components/FilterBoxes/TopicsFilter.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/front/app/components/FilterBoxes/TopicsFilter.tsx b/front/app/components/FilterBoxes/TopicsFilter.tsx index 52ed2017fcd9..4117b762fe99 100644 --- a/front/app/components/FilterBoxes/TopicsFilter.tsx +++ b/front/app/components/FilterBoxes/TopicsFilter.tsx @@ -180,7 +180,6 @@ const TopicsFilter = memo( p="0px" mt="12px" fontSize="s" - id="e2e-show-all-tags-button" > {formatMessage( showFullList