Skip to content

Commit 96d8e19

Browse files
committed
test(tabs): update for track func for index-testing spec
1 parent 5f8d116 commit 96d8e19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

projects/igniteui-angular/src/lib/test-utils/tabs-components.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class TabsTestComponent {
9898
template: `
9999
<div #wrapperDiv style="display: flex;">
100100
<igx-tabs>
101-
@for (tab of collection; track tab.name) {
101+
@for (tab of collection; track trackByItemRef(tab)) {
102102
<igx-tab-item>
103103
<igx-tab-header><span igxTabHeaderLabel>{{ tab.name }}</span></igx-tab-header>
104104
<igx-tab-content></igx-tab-content>
@@ -151,6 +151,9 @@ export class TabsTest2Component {
151151
public resetToEmptyCollection() {
152152
this.collection = [];
153153
}
154+
155+
/** Explicitly track object so collection changes entirely for index logic test */
156+
protected trackByItemRef = (x: any) => x;
154157
}
155158

156159
@Component({

0 commit comments

Comments
 (0)