diff --git a/frontend/cypress/e2e/pages/SearchPage.cy.ts b/frontend/cypress/e2e/pages/SearchPage.cy.ts index cfe6e589b5..a715a9b1b5 100644 --- a/frontend/cypress/e2e/pages/SearchPage.cy.ts +++ b/frontend/cypress/e2e/pages/SearchPage.cy.ts @@ -157,7 +157,7 @@ describe("Search Page", () => { .should("have.length.greaterThan", 0) .should("be.visible"); - cy.get("#search-box").find(`cds-combo-box-item[data-value^="${clientNumber}"]`).click(); + cy.get("#search-box").find(`cds-combo-box-item[data-id="${clientNumber}"]`).click(); }); it("navigates to the client details", () => { const greenDomain = "green-domain.com"; @@ -396,4 +396,36 @@ describe("Search Page", () => { }); }); }); + + describe("when the API finds no matching results", () => { + beforeEach(() => { + // The "empty" value actually triggers the empty array response + cy.fillFormEntry("#search-box", "empty"); + }); + describe("and user clicks the Search button", () => { + beforeEach(() => { + cy.get("#search-button").click(); + }); + + it('displays a "No results" message that includes the submitted search value', () => { + cy.wait("@fullSearch"); + + cy.contains("No results for “empty”"); + }); + + describe("and the user types something else in the search box but does not re-submit the full search", () => { + beforeEach(() => { + cy.wait("@fullSearch"); + + cy.fillFormEntry("#search-box", "other"); + }); + + it('still displays the "No results" message with the value that was previously submitted', () => { + cy.wait(200); + + cy.contains("No results for “empty”"); + }); + }); + }); + }); }); diff --git a/frontend/src/assets/styles/global.scss b/frontend/src/assets/styles/global.scss index 43e8aca81b..50681690d1 100644 --- a/frontend/src/assets/styles/global.scss +++ b/frontend/src/assets/styles/global.scss @@ -1641,14 +1641,42 @@ div.internal-grouping-01:has(svg.warning) span.body-compact-01 { } #search-line { + --lg-size: 3rem; + --padding-size: 2.5rem; + display: flex; - align-items: flex-end; + align-items: flex-start; + min-height: calc(var(--lg-size) + var(--padding-size)); + padding: 0 var(--padding-size); .grouping-02 { flex-grow: 1; } } +#search-box { + --row-height: 2.875rem; + + cds-combo-box-item { + block-size: var(--row-height); + } + + &::part(cds--combo-box), &::part(input) { + border-bottom-width: 0; + } + + &::part(input)::placeholder { + color: var(--light-theme-text-text-primary); + } +} + +.search-result-item { + display: flex; + gap: 1rem; + align-items: center; + margin: -0.0625rem 0; +} + #search-button { width: 7.875rem; } diff --git a/frontend/src/components/forms/AutoCompleteInputComponent.vue b/frontend/src/components/forms/AutoCompleteInputComponent.vue index a6a3833b83..c71f634a46 100644 --- a/frontend/src/components/forms/AutoCompleteInputComponent.vue +++ b/frontend/src/components/forms/AutoCompleteInputComponent.vue @@ -1,4 +1,4 @@ -