33 * Copied from https://github.com/angular/angular/blob/19.2.15/packages/router/test/integration/integration_helpers.ts
44 * with the following modifications:
55 * - modify imports
6+ * - uniquify all 'link-cmp' selectors to avoid NG0912 component ID collision. Approach based on: https://angular.io/errors/NG0912#debugging-the-error
67 */
78
89/**
@@ -47,28 +48,28 @@ export function onlyNavigationStartAndEnd(e: Event): e is NavigationStart | Navi
4748}
4849
4950@Component ( {
50- selector : 'link-cmp' ,
51+ selector : 'link-cmp:not([nimble-unused-0]) ' ,
5152 template : `<a routerLink="/team/33/simple" [target]="'_self'">link</a>` ,
5253 standalone : false ,
5354} )
5455export class StringLinkCmp { }
5556
5657@Component ( {
57- selector : 'link-cmp' ,
58+ selector : 'link-cmp:not([nimble-unused-1]) ' ,
5859 template : `<button routerLink="/team/33/simple">link</button>` ,
5960 standalone : false ,
6061} )
6162export class StringLinkButtonCmp { }
6263
6364@Component ( {
64- selector : 'link-cmp' ,
65+ selector : 'link-cmp:not([nimble-unused-2]) ' ,
6566 template : `<router-outlet></router-outlet><a [routerLink]="['/team/33/simple']">link</a>` ,
6667 standalone : false ,
6768} )
6869export class AbsoluteLinkCmp { }
6970
7071@Component ( {
71- selector : 'link-cmp' ,
72+ selector : 'link-cmp:not([nimble-unused-3]) ' ,
7273 template : `<router-outlet></router-outlet><a routerLinkActive="active" (isActiveChange)="this.onRouterLinkActivated($event)" [routerLinkActiveOptions]="{exact: exact}" ariaCurrentWhenActive="page" [routerLink]="['./']">link</a>
7374 <button routerLinkActive="active" [routerLinkActiveOptions]="{exact: exact}" [routerLink]="['./']">button</button>
7475 ` ,
@@ -88,28 +89,28 @@ export class DummyLinkCmp {
8889}
8990
9091@Component ( {
91- selector : 'link-cmp' ,
92+ selector : 'link-cmp:not([nimble-unused-4]) ' ,
9293 template : `<a [routerLink]="['/simple']">link</a>` ,
9394 standalone : false ,
9495} )
9596export class AbsoluteSimpleLinkCmp { }
9697
9798@Component ( {
98- selector : 'link-cmp' ,
99+ selector : 'link-cmp:not([nimble-unused-5]) ' ,
99100 template : `<a [routerLink]="['../simple']">link</a>` ,
100101 standalone : false ,
101102} )
102103export class RelativeLinkCmp { }
103104
104105@Component ( {
105- selector : 'link-cmp' ,
106+ selector : 'link-cmp:not([nimble-unused-6]) ' ,
106107 template : `<a [routerLink]="['../simple']" [queryParams]="{q: '1'}" fragment="f">link</a>` ,
107108 standalone : false ,
108109} )
109110export class LinkWithQueryParamsAndFragment { }
110111
111112@Component ( {
112- selector : 'link-cmp' ,
113+ selector : 'link-cmp:not([nimble-unused-7]) ' ,
113114 template : `<a id="link" [routerLink]="['../simple']" [state]="{foo: 'bar'}">link</a>` ,
114115 standalone : false ,
115116} )
@@ -263,7 +264,7 @@ export class RouteCmp {
263264}
264265
265266@Component ( {
266- selector : 'link-cmp' ,
267+ selector : 'link-cmp:not([nimble-unused-8]) ' ,
267268 template : `<div *ngIf="show"><a [routerLink]="['./simple']">link</a></div> <router-outlet></router-outlet>` ,
268269 standalone : false ,
269270} )
@@ -281,7 +282,7 @@ export class OutletInNgIf {
281282}
282283
283284@Component ( {
284- selector : 'link-cmp' ,
285+ selector : 'link-cmp:not([nimble-unused-9]) ' ,
285286 template : `<router-outlet></router-outlet>
286287 <div id="link-parent" routerLinkActive="active" [routerLinkActiveOptions]="{exact: exact}">
287288 <div ngClass="{one: 'true'}"><a [routerLink]="['./']">link</a></div>
0 commit comments