@@ -183,6 +183,121 @@ export class GridLayoutTest extends testModule.UITest<RemovalTrackingGridLayout>
183
183
GridLayout . setColumnSpan ( new Button ( ) , 0 ) ;
184
184
}
185
185
186
+ public test_addChildAtCell_with_all_params ( ) {
187
+ let btn = new Button ( ) ;
188
+ let row : number = 1 ;
189
+ let column : number = 2 ;
190
+ let rowSpan : number = 3 ;
191
+ let columnSpan : number = 4 ;
192
+ this . testView . addChildAtCell ( btn , row , column , rowSpan , columnSpan ) ;
193
+ TKUnit . assertEqual (
194
+ this . row ( btn ) ,
195
+ row ,
196
+ "'row' property not applied For GridLayout addChildAtCell."
197
+ ) ;
198
+ TKUnit . assertEqual (
199
+ this . col ( btn ) ,
200
+ column ,
201
+ "'column' property not applied For GridLayout addChildAtCell."
202
+ ) ;
203
+ TKUnit . assertEqual (
204
+ this . rowSpan ( btn ) ,
205
+ rowSpan ,
206
+ "'rowSpan' property not applied For GridLayout addChildAtCell."
207
+ ) ;
208
+ TKUnit . assertEqual (
209
+ this . colSpan ( btn ) ,
210
+ columnSpan ,
211
+ "'columnSpan' property not applied For GridLayout addChildAtCell."
212
+ ) ;
213
+ }
214
+
215
+ public test_addChildAtCell_without_optional_params ( ) {
216
+ let btn = new Button ( ) ;
217
+ let row : number = 1 ;
218
+ let column : number = 2 ;
219
+ let defaultSpanValue : number = 1 ;
220
+ this . testView . addChildAtCell ( btn , row , column ) ;
221
+ TKUnit . assertEqual (
222
+ this . row ( btn ) ,
223
+ row ,
224
+ "'row' property not applied For GridLayout addChildAtCell."
225
+ ) ;
226
+ TKUnit . assertEqual (
227
+ this . col ( btn ) ,
228
+ column ,
229
+ "'column' property not applied For GridLayout addChildAtCell."
230
+ ) ;
231
+ TKUnit . assertEqual (
232
+ this . rowSpan ( btn ) ,
233
+ defaultSpanValue ,
234
+ "'rowSpan' property not applied For GridLayout addChildAtCell without optional params."
235
+ ) ;
236
+ TKUnit . assertEqual (
237
+ this . colSpan ( btn ) ,
238
+ defaultSpanValue ,
239
+ "'colSpan' property not applied For GridLayout addChildAtCell without optional params."
240
+ ) ;
241
+ }
242
+
243
+ public test_addChildAtCell_without_rowSpan ( ) {
244
+ let btn = new Button ( ) ;
245
+ let row : number = 1 ;
246
+ let column : number = 2 ;
247
+ let columnSpan : number = 2 ;
248
+ let defaultSpanValue : number = 1 ;
249
+ this . testView . addChildAtCell ( btn , row , column , undefined , columnSpan ) ;
250
+ TKUnit . assertEqual (
251
+ this . row ( btn ) ,
252
+ row ,
253
+ "'row' property not applied For GridLayout addChildAtCell without rowspan."
254
+ ) ;
255
+ TKUnit . assertEqual (
256
+ this . col ( btn ) ,
257
+ column ,
258
+ "'column' property not applied For GridLayout addChildAtCell without rowspan."
259
+ ) ;
260
+ TKUnit . assertEqual (
261
+ this . rowSpan ( btn ) ,
262
+ defaultSpanValue ,
263
+ "'rowSpan' property not applied For GridLayout addChildAtCell without rowspan."
264
+ ) ;
265
+ TKUnit . assertEqual (
266
+ this . colSpan ( btn ) ,
267
+ columnSpan ,
268
+ "'columnSpan' property not applied For GridLayout addChildAtCell without rowspan."
269
+ ) ;
270
+ }
271
+
272
+ public test_addChildAtCell_without_columnSpan ( ) {
273
+ let btn = new Button ( ) ;
274
+ let row : number = 1 ;
275
+ let column : number = 2 ;
276
+ let rowSpan : number = 2 ;
277
+ let defaultSpanValue : number = 1 ;
278
+ this . testView . addChildAtCell ( btn , row , column , rowSpan ) ;
279
+ TKUnit . assertEqual (
280
+ this . row ( btn ) ,
281
+ row ,
282
+ "'row' property not applied For GridLayout addChildAtCell without columnSpan."
283
+ ) ;
284
+ TKUnit . assertEqual (
285
+ this . col ( btn ) ,
286
+ column ,
287
+ "'column' property not applied For GridLayout addChildAtCell without columnSpan."
288
+ ) ;
289
+ TKUnit . assertEqual (
290
+ this . rowSpan ( btn ) ,
291
+ rowSpan ,
292
+ "'rowSpan' property not applied For GridLayout addChildAtCell without columnSpan."
293
+ ) ;
294
+ TKUnit . assertEqual (
295
+ this . colSpan ( btn ) ,
296
+ defaultSpanValue ,
297
+ "'columnSpan' property not applied For GridLayout addChildAtCell without columnSpan."
298
+ ) ;
299
+ }
300
+
186
301
public test_addRow_shouldThrow_onNullValues ( ) {
187
302
TKUnit . assertThrows ( ( ) => {
188
303
this . testView . addRow ( null ) ;
0 commit comments