From 357e902df7e63312e307057903567f16e551c048 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Thu, 1 Feb 2024 15:49:30 +0100 Subject: [PATCH] Add e2e test for keyword click --- apps/datahub-e2e/src/e2e/search.cy.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/datahub-e2e/src/e2e/search.cy.ts b/apps/datahub-e2e/src/e2e/search.cy.ts index 71e3e81b..59f85d18 100644 --- a/apps/datahub-e2e/src/e2e/search.cy.ts +++ b/apps/datahub-e2e/src/e2e/search.cy.ts @@ -39,5 +39,18 @@ describe('datahub-e2e', () => { cy.url().should('match', urlRegex) cy.get('mel-datahub-dataset-page').should('be.visible') }) + it('should filter the search by clicked keyword', () => { + const urlRegex = /http:\/\/[^\/]+:\d+\/search\?q=.+/ + cy.get('@firstResult') + .find('.mel-badge-button') + .first() + .as('firstKeyWord') + .should('have.text', ' Usage des sols ') + + cy.get('@firstKeyWord').click() + cy.url().should('match', urlRegex) + + cy.get('mel-datahub-results-card-search').should('be.visible') + }) }) })