Skip to content

Commit ce35ce4

Browse files
authored
Merge pull request #15417 from IgniteUI/dpetev/control-flow-test-track
test(*): apply control flow suggestions
2 parents 7605893 + 847f865 commit ce35ce4

26 files changed

+90
-90
lines changed

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ describe('igxGridEditingActions #grid ', () => {
390390
template: `
391391
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'"
392392
[rowEditable]="true" [primaryKey]="'ID'">
393-
@for (c of columns; track c) {
393+
@for (c of columns; track c.field) {
394394
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
395395
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
396396
</igx-column>
@@ -469,7 +469,7 @@ class IgxActionStripTestingComponent implements OnInit {
469469
template: `
470470
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'"
471471
[rowEditable]="true" [primaryKey]="'ID'">
472-
@for (c of columns; track c) {
472+
@for (c of columns; track c.field) {
473473
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
474474
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
475475
</igx-column>
@@ -491,7 +491,7 @@ class IgxActionStripPinEditComponent extends IgxActionStripTestingComponent {
491491
template: `
492492
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'"
493493
[rowEditable]="true" [primaryKey]="'ID'">
494-
@for (c of columns; track c) {
494+
@for (c of columns; track c.field) {
495495
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
496496
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
497497
</igx-column>
@@ -512,7 +512,7 @@ class IgxActionStripEditMenuComponent extends IgxActionStripTestingComponent {
512512
template: `
513513
<igx-grid #grid [data]="dataOneRow" [width]="'800px'" [height]="'500px'"
514514
[rowEditable]="true" [primaryKey]="'ID'">
515-
@for (c of columns; track c) {
515+
@for (c of columns; track c.field) {
516516
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
517517
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
518518
</igx-column>
@@ -534,7 +534,7 @@ class IgxActionStripOneRowComponent extends IgxActionStripTestingComponent {
534534
template: `
535535
<igx-grid #grid [data]="dataOneRow" [width]="'800px'" [height]="'500px'"
536536
[rowEditable]="true" [primaryKey]="'ID'">
537-
@for (c of columns; track c) {
537+
@for (c of columns; track c.field) {
538538
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
539539
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
540540
</igx-column>

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('igxGridPinningActions #grid ', () => {
102102
template: `
103103
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'"
104104
[rowEditable]="true" [primaryKey]="'ID'">
105-
@for (c of columns; track c) {
105+
@for (c of columns; track c.field) {
106106
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
107107
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
108108
</igx-column>
@@ -176,7 +176,7 @@ class IgxActionStripTestingComponent implements OnInit {
176176
template: `
177177
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'"
178178
[rowEditable]="true" [primaryKey]="'ID'">
179-
@for (c of columns; track c) {
179+
@for (c of columns; track c.field) {
180180
<igx-column [sortable]="true" [field]="c.field" [header]="c.field"
181181
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'>
182182
</igx-column>

projects/igniteui-angular/src/lib/buttonGroup/buttongroup.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class ButtonGroupWithSelectedButtonComponent {
584584
@Component({
585585
template: `
586586
<igx-buttongroup>
587-
@for (item of items; track item) {
587+
@for (item of items; track item.key) {
588588
<button igxButton [selected]="item.key === selectedValue">{{item.value}}</button>
589589
}
590590
</igx-buttongroup>

projects/igniteui-angular/src/lib/chips/chip.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { getComponentSize } from '../core/utils';
1515
@Component({
1616
template: `
1717
<igx-chips-area #chipsArea>
18-
@for (chip of chipList; track chip) {
18+
@for (chip of chipList; track chip.id) {
1919
<igx-chip #chipElem class="custom"
2020
[id]="chip.id" [draggable]="chip.draggable"
2121
[removable]="chip.removable" [selectable]="chip.selectable"
@@ -69,7 +69,7 @@ class TestChipComponent {
6969
@Component({
7070
template: `
7171
<igx-chips-area>
72-
@for (chip of chipList; track chip) {
72+
@for (chip of chipList; track chip.id) {
7373
<igx-chip>
7474
<span igxLabel>label</span>
7575
<span igxSuffix>suf</span>

projects/igniteui-angular/src/lib/chips/chips-area.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { IgxPrefixDirective } from './public_api';
1111
@Component({
1212
template: `
1313
<igx-chips-area #chipsArea class="customClass">
14-
@for (chip of chipList; track chip) {
14+
@for (chip of chipList; track chip.id) {
1515
<igx-chip #chipElem
1616
[id]="chip.id" [draggable]="chip.draggable" [removable]="chip.removable" [selectable]="chip.selectable">
1717
<igx-icon igxPrefix>drag_indicator</igx-icon>
@@ -59,7 +59,7 @@ class TestChipSelectComponent extends TestChipComponent {
5959
@Component({
6060
template: `
6161
<igx-chips-area #chipsArea (reorder)="chipsOrderChanged($event)">
62-
@for (chip of chipList; track chip) {
62+
@for (chip of chipList; track chip.id) {
6363
<igx-chip #chipElem [id]="chip.id" [draggable]="true"
6464
[removable]="true" [selectable]="true" (remove)="chipRemoved($event)">
6565
<igx-icon igxPrefix>drag_indicator</igx-icon>

projects/igniteui-angular/src/lib/directives/filter/filter.directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class DeclarativeListTestComponent {
213213
@Component({
214214
template: `
215215
<igx-list>
216-
@for (item of dataSourceItems | igxFilter: fo; track item) {
216+
@for (item of dataSourceItems | igxFilter: fo; track item.key) {
217217
<igx-list-item> {{item.text}} </igx-list-item>
218218
}
219219
</igx-list>`,

projects/igniteui-angular/src/lib/drop-down/drop-down.component.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ describe('IgxDropDown ', () => {
12981298
<button (click)="toggleDropDown()">Toggle</button>
12991299
<igx-drop-down id="test-id" igxDropDownItemNavigation [maxHeight]="maxHeight"
13001300
[allowItemsFocus]="true" style="--ig-size: var(--ig-size-medium);">
1301-
@for (item of items; track item) {
1301+
@for (item of items; track item.field) {
13021302
<igx-drop-down-item [disabled]="item.disabled" [isHeader]="item.header" [selected]="item.selected">
13031303
{{item.field}}
13041304
</igx-drop-down-item>
@@ -1338,14 +1338,14 @@ class IgxDropDownTestComponent {
13381338
template: `
13391339
<button (click)="selectItem5()">Select 5</button>
13401340
<igx-drop-down #dropdown1>
1341-
@for (item of items; track item) {
1341+
@for (item of items; track item.field) {
13421342
<igx-drop-down-item>
13431343
{{ item.field }}
13441344
</igx-drop-down-item>
13451345
}
13461346
</igx-drop-down>
13471347
<igx-drop-down #dropdown2>
1348-
@for (item of items; track item) {
1348+
@for (item of items; track item.field) {
13491349
<igx-drop-down-item>
13501350
{{ item.field }}
13511351
</igx-drop-down-item>
@@ -1403,7 +1403,7 @@ class DoubleIgxDropDownComponent implements OnInit {
14031403
<igx-drop-down igxDropDownItemNavigation (selectionChanging)="selectionChanging($event)"
14041404
(opening)="onToggleOpening()" (opened)="onToggleOpened()"
14051405
(closing)="onToggleClosing()" (closed)="onToggleClosed()" [width]="'400px'" [height]="'400px'">
1406-
@for (item of items; track item) {
1406+
@for (item of items; track item.field) {
14071407
<igx-drop-down-item>
14081408
{{ item.field }}
14091409
</igx-drop-down-item>
@@ -1441,7 +1441,7 @@ class IgxDropDownAnchorTestComponent {
14411441
@Component({
14421442
template: ` <input #inputElement [igxDropDownItemNavigation]="dropdownElement" class='test-input' type='text' value='Focus Me!'/>
14431443
<igx-drop-down #dropdownElement [width]="'400px'" [height]="'400px'" [allowItemsFocus]="true">
1444-
@for (item of items; track item) {
1444+
@for (item of items; track item.field) {
14451445
<igx-drop-down-item>
14461446
{{ item.field }}
14471447
</igx-drop-down-item>
@@ -1466,9 +1466,9 @@ class InputWithDropDownDirectiveComponent {
14661466
@Component({
14671467
template: `
14681468
<igx-drop-down>
1469-
@for (parent of data; track parent) {
1469+
@for (parent of data; track parent.name) {
14701470
<igx-drop-down-item-group [label]="parent.name">
1471-
@for (child of parent.children; track child) {
1471+
@for (child of parent.children; track child.value) {
14721472
<igx-drop-down-item [value]="child.value">
14731473
{{ child.name }}
14741474
</igx-drop-down-item>

projects/igniteui-angular/src/lib/grids/grid/cell.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ describe('IgxGrid - Cell component #grid', () => {
405405
@Component({
406406
template: `
407407
<igx-grid #grid [data]="data" [primaryKey]="'ProductID'" [width]="'900px'" [height]="'500px'" rowSelection = "multiple" [moving]="true">
408-
@for (c of columns; track c) {
408+
@for (c of columns; track c.field) {
409409
<igx-column [field]="c.field"
410410
[header]="c.field"
411411
[width]="c.width"

projects/igniteui-angular/src/lib/grids/grid/grid-mrl-keyboard-nav.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ViewChild } from '@angular/core';
1+
import { Component, ViewChild } from '@angular/core';
22
import { TestBed, ComponentFixture, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
44
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -2622,9 +2622,9 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
26222622
@Component({
26232623
template: `
26242624
<igx-grid #grid [data]="data" [height]="'500px'" (selected)="cellSelected($event)">
2625-
@for (group of colGroups; track group) {
2625+
@for (group of colGroups; track group.group) {
26262626
<igx-column-layout [hidden]='group.hidden' [pinned]='group.pinned' [field]='group.group'>
2627-
@for (col of group.columns; track col) {
2627+
@for (col of group.columns; track col.field) {
26282628
<igx-column
26292629
[rowStart]="col.rowStart" [colStart]="col.colStart" [width]='col.width'
26302630
[colEnd]="col.colEnd" [rowEnd]="col.rowEnd" [field]='col.field' [editable]='col.editable'></igx-column>

projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,9 +1436,9 @@ export class GridRowPinningComponent {
14361436
template: `
14371437
<igx-grid [data]="data" height="500px" [pinning]='pinningConfig' [rowSelection]="'single'"
14381438
[rowEditable]="true">
1439-
@for (group of colGroups; track group) {
1439+
@for (group of colGroups; track group.group) {
14401440
<igx-column-layout>
1441-
@for (col of group.columns; track col) {
1441+
@for (col of group.columns; track col.field) {
14421442
<igx-column
14431443
[rowStart]="col.rowStart" [colStart]="col.colStart" [width]='col.width'
14441444
[colEnd]="col.colEnd" [rowEnd]="col.rowEnd" [field]='col.field'></igx-column>

0 commit comments

Comments
 (0)