@@ -30,6 +30,170 @@ describe(`Update to ${version}`, () => {
3030
3131 const migrationName = 'migration-38' ;
3232
33+ it ( 'should remove displayDensity property from igx-grid and replace it with inline style if its value is not set to a component member' , async ( ) => {
34+ appTree . create (
35+ '/testSrc/appPrefix/component/test.component.html' , `
36+ <igx-grid [data]="data" [displayDensity]="'cosy'" height="300px" width="300px">
37+ <igx-column field="Name" header="Athlete"></igx-column>
38+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
39+ <igx-column field="CountryFlag" header="Country"></igx-column>
40+ </igx-grid>
41+ <igx-grid [data]="data" displayDensity="cosy" height="300px" width="300px">
42+ <igx-column field="Name" header="Athlete"></igx-column>
43+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
44+ <igx-column field="CountryFlag" header="Country"></igx-column>
45+ </igx-grid>` ) ;
46+
47+ const tree = await schematicRunner . runSchematic ( migrationName , { shouldInvokeLS : false } , appTree ) ;
48+
49+ expect ( tree . readContent ( '/testSrc/appPrefix/component/test.component.html' ) )
50+ . toEqual ( `
51+ <igx-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-medium)'">
52+ <igx-column field="Name" header="Athlete"></igx-column>
53+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
54+ <igx-column field="CountryFlag" header="Country"></igx-column>
55+ </igx-grid>
56+ <igx-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-medium)'">
57+ <igx-column field="Name" header="Athlete"></igx-column>
58+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
59+ <igx-column field="CountryFlag" header="Country"></igx-column>
60+ </igx-grid>` ) ;
61+ } ) ;
62+
63+ it ( 'should only remove and not replace displayDensity property from igx-grid if it is bound to something different than a value' , async ( ) => {
64+ appTree . create (
65+ '/testSrc/appPrefix/component/test.component.html' , `
66+ <igx-grid [data]="data" [displayDensity]="density" height="300px" width="300px">
67+ <igx-column field="Name" header="Athlete"></igx-column>
68+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
69+ <igx-column field="CountryFlag" header="Country"></igx-column>
70+ </igx-grid>` ) ;
71+
72+ const tree = await schematicRunner . runSchematic ( migrationName , { shouldInvokeLS : false } , appTree ) ;
73+
74+ expect ( tree . readContent ( '/testSrc/appPrefix/component/test.component.html' ) )
75+ . toEqual ( `
76+ <igx-grid [data]="data" height="300px" width="300px">
77+ <igx-column field="Name" header="Athlete"></igx-column>
78+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
79+ <igx-column field="CountryFlag" header="Country"></igx-column>
80+ </igx-grid>` ) ;
81+ } ) ;
82+
83+ it ( 'should remove displayDensity property from igx-tree-grid and replace it with inline style if its value is not set to a component member' , async ( ) => {
84+ appTree . create (
85+ '/testSrc/appPrefix/component/test.component.html' , `
86+ <igx-tree-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
87+ <igx-column field="Name" header="Athlete"></igx-column>
88+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
89+ <igx-column field="CountryFlag" header="Country"></igx-column>
90+ </igx-tree-grid>
91+ <igx-tree-grid [data]="data" displayDensity="compact" height="300px" width="300px">
92+ <igx-column field="Name" header="Athlete"></igx-column>
93+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
94+ <igx-column field="CountryFlag" header="Country"></igx-column>
95+ </igx-tree-grid>` ) ;
96+
97+ const tree = await schematicRunner . runSchematic ( migrationName , { shouldInvokeLS : false } , appTree ) ;
98+
99+ expect ( tree . readContent ( '/testSrc/appPrefix/component/test.component.html' ) )
100+ . toEqual ( `
101+ <igx-tree-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
102+ <igx-column field="Name" header="Athlete"></igx-column>
103+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
104+ <igx-column field="CountryFlag" header="Country"></igx-column>
105+ </igx-tree-grid>
106+ <igx-tree-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
107+ <igx-column field="Name" header="Athlete"></igx-column>
108+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
109+ <igx-column field="CountryFlag" header="Country"></igx-column>
110+ </igx-tree-grid>` ) ;
111+ } ) ;
112+
113+ it ( 'should remove displayDensity property from igx-pivot-grid and replace it with inline style if its value is not set to a component member' , async ( ) => {
114+ appTree . create (
115+ '/testSrc/appPrefix/component/test.component.html' , `
116+ <igx-pivot-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
117+ <igx-column field="Name" header="Athlete"></igx-column>
118+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
119+ <igx-column field="CountryFlag" header="Country"></igx-column>
120+ </igx-pivot-grid>
121+ <igx-pivot-grid [data]="data" displayDensity="compact" height="300px" width="300px">
122+ <igx-column field="Name" header="Athlete"></igx-column>
123+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
124+ <igx-column field="CountryFlag" header="Country"></igx-column>
125+ </igx-pivot-grid>` ) ;
126+
127+ const tree = await schematicRunner . runSchematic ( migrationName , { shouldInvokeLS : false } , appTree ) ;
128+
129+ expect ( tree . readContent ( '/testSrc/appPrefix/component/test.component.html' ) )
130+ . toEqual ( `
131+ <igx-pivot-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
132+ <igx-column field="Name" header="Athlete"></igx-column>
133+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
134+ <igx-column field="CountryFlag" header="Country"></igx-column>
135+ </igx-pivot-grid>
136+ <igx-pivot-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
137+ <igx-column field="Name" header="Athlete"></igx-column>
138+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
139+ <igx-column field="CountryFlag" header="Country"></igx-column>
140+ </igx-pivot-grid>` ) ;
141+ } ) ;
142+
143+ it ( 'should remove displayDensity property from igx-hierarchical-grid and igx-row-island and replace it with inline style if its value is not set to a component member' , async ( ) => {
144+ appTree . create (
145+ '/testSrc/appPrefix/component/test.component.html' , `
146+ <igx-hierarchical-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
147+ <igx-column field="Name" header="Athlete"></igx-column>
148+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
149+ <igx-column field="CountryFlag" header="Country"></igx-column>
150+ <igx-row-island [displayDensity]="'comfortable'">
151+ <igx-column field="Name" header="Athlete"></igx-column>
152+ <igx-row-island [displayDensity]="'compact'">
153+ <igx-column field="Name" header="Athlete"></igx-column>
154+ <igx-row-island/>
155+ <igx-row-island/>
156+ </igx-hierarchical-grid>
157+ <igx-hierarchical-grid [data]="data" displayDensity="compact" height="300px" width="300px">
158+ <igx-column field="Name" header="Athlete"></igx-column>
159+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
160+ <igx-column field="CountryFlag" header="Country"></igx-column>
161+ <igx-row-island displayDensity="comfortable">
162+ <igx-column field="Name" header="Athlete"></igx-column>
163+ <igx-row-island displayDensity="cosy">
164+ <igx-column field="Name" header="Athlete"></igx-column>
165+ <igx-row-island/>
166+ <igx-row-island/>
167+ </igx-hierarchical-grid>` ) ;
168+
169+ const tree = await schematicRunner . runSchematic ( migrationName , { shouldInvokeLS : false } , appTree ) ;
170+
171+ expect ( tree . readContent ( '/testSrc/appPrefix/component/test.component.html' ) )
172+ . toEqual ( `
173+ <igx-hierarchical-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
174+ <igx-column field="Name" header="Athlete"></igx-column>
175+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
176+ <igx-column field="CountryFlag" header="Country"></igx-column>
177+ <igx-row-island [style.--ig-size]="'var(--ig-size-large)'">
178+ <igx-column field="Name" header="Athlete"></igx-column>
179+ <igx-row-island [style.--ig-size]="'var(--ig-size-small)'">
180+ <igx-column field="Name" header="Athlete"></igx-column>
181+ <igx-row-island/>
182+ <igx-row-island/>
183+ </igx-hierarchical-grid>
184+ <igx-hierarchical-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
185+ <igx-column field="Name" header="Athlete"></igx-column>
186+ <igx-column field="TrackProgress" header="Track Progress"></igx-column>
187+ <igx-column field="CountryFlag" header="Country"></igx-column>
188+ <igx-row-island [style.--ig-size]="'var(--ig-size-large)'">
189+ <igx-column field="Name" header="Athlete"></igx-column>
190+ <igx-row-island [style.--ig-size]="'var(--ig-size-medium)'">
191+ <igx-column field="Name" header="Athlete"></igx-column>
192+ <igx-row-island/>
193+ <igx-row-island/>
194+ </igx-hierarchical-grid>` ) ;
195+ } ) ;
196+
33197 it ( 'should replace PivotGrid property `showPivotConfigurationUI` with `pivotUI`' , async ( ) => {
34198 appTree . create ( `/testSrc/appPrefix/component/test.component.html` ,
35199 `
0 commit comments