Skip to content

TUL/Fix duplicate id#1242

Merged
milanmajchrak merged 5 commits intocustomer/TULfrom
tul/duplicate-id-fix
Mar 10, 2026
Merged

TUL/Fix duplicate id#1242
milanmajchrak merged 5 commits intocustomer/TULfrom
tul/duplicate-id-fix

Conversation

@Kasinhou
Copy link

@Kasinhou Kasinhou commented Mar 10, 2026

Problem description

Found duplicate id in html:

Error: Found duplicate IDs on http://dev-5.pc:86/home:
    search-navbar-container (2x)

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["search-navbar-container (2x)"]

Sync verification

If en.json5 or cs.json5 translation files were updated:

  • Run yarn run sync-i18n -t src/assets/i18n/cs.json5 -i to synchronize messages, and changes are included in this PR.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a duplicate HTML id attribute issue where id="search-navbar-container" appeared multiple times on the page because the ds-search-navbar component is rendered in both the header and the navbar. The fix changes the id to a class, which is valid for multiple instances.

Changes:

  • Changed id="search-navbar-container" to class="search-navbar-container" in the search navbar template to eliminate duplicate IDs
  • Updated all CSS selectors in the spec file from #search-navbar-container to .search-navbar-container
  • Removed the now-obsolete cypress exclusion comment that referenced this duplicate ID issue

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/app/search-navbar/search-navbar.component.html Changed id to class on the container div to avoid duplicate IDs
src/app/search-navbar/search-navbar.component.spec.ts Updated 4 CSS selectors from ID (#) to class (.) to match the template change
cypress/integration/header.spec.ts Removed comment that excluded #search-navbar-container from a11y tests due to the now-fixed duplicate ID

@Kasinhou Kasinhou requested a review from milanmajchrak March 10, 2026 14:44
@milanmajchrak milanmajchrak merged commit 8c43e90 into customer/TUL Mar 10, 2026
7 checks passed
@Kasinhou Kasinhou self-assigned this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants