From b895b8e0b354b2b6047eebd7a76b4d04af62db81 Mon Sep 17 00:00:00 2001 From: Fernando Terra Date: Mon, 4 Nov 2024 18:47:59 -0300 Subject: [PATCH] fix: do not remove duplicate spaces in the middle of the string --- 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