From 63e0fde4037b566f6266b4273001334e92fd2fc8 Mon Sep 17 00:00:00 2001 From: Fernando Terra <79578735+fterra-encora@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:34:10 -0300 Subject: [PATCH] fix(fe:FSADT1-1569): do not remove duplicate spaces in the middle of the search terms (#1296) fix: do not remove duplicate spaces in the middle of the string Co-authored-by: Maria Martinez <77364706+mamartinezmejia@users.noreply.github.com> --- frontend/cypress/e2e/pages/SearchPage.cy.ts | 2 +- frontend/src/pages/SearchPage.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/e2e/pages/SearchPage.cy.ts b/frontend/cypress/e2e/pages/SearchPage.cy.ts index a26afcfac..082d4bb12 100644 --- a/frontend/cypress/e2e/pages/SearchPage.cy.ts +++ b/frontend/cypress/e2e/pages/SearchPage.cy.ts @@ -345,7 +345,7 @@ describe("Search Page", () => { describe("when user fills in the search box with extra spaces", () => { beforeEach(() => { - cy.fillFormEntry("#search-box", " hello world ", { skipBlur: true }); + cy.fillFormEntry("#search-box", " hello world ", { skipBlur: true }); }); it("trims the entered string before making the API call", () => { diff --git a/frontend/src/pages/SearchPage.vue b/frontend/src/pages/SearchPage.vue index 02fc8fde4..1a48b48a5 100644 --- a/frontend/src/pages/SearchPage.vue +++ b/frontend/src/pages/SearchPage.vue @@ -45,7 +45,7 @@ const pageSize = ref(10); const rawSearchKeyword = ref(""); -const searchKeyword = computed(() => rawSearchKeyword.value.trim().replaceAll(/ +/g, " ")); +const searchKeyword = computed(() => rawSearchKeyword.value.trim()); const lastSearchKeyword = ref(""); // empty is valid