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