ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
32 stars 8 forks source link

Avoid Angular component ID collision test failure #2087

Closed m-akinc closed 4 months ago

m-akinc commented 4 months ago

Pull Request

๐Ÿคจ Rationale

A build hit a test failure unrelated to the changes in that PR: https://github.com/ni/nimble/actions/runs/9009318573/job/24753280540?pr=2083

๐Ÿ‘ฉโ€๐Ÿ’ป Implementation

In one of the test files we forked from Angular (router_integration_spec.ts) there are two components, AbsoluteSimpleLinkCmp and RelativeLinkCmp that have identical selector and template values, which can lead to component ID collisions. We worked around this by adding an irrelevant :not(head) to RelativeLinkCmp's selector, however it turns out that there is another definition of RelativeLinkCmp earlier in the file (with unmodified selector) that can still lead to an ID collision. I switched the selector "uniquification" to AbsoluteSimpleLinkCmp, so now it should not collide with either of the RelativeLinkCmp definitions.

๐Ÿงช Testing

Ran tests locally.

โœ… Checklist