Skip to content

Commit fb24c13

Browse files
author
Vladimir Enchev
committed
Merge pull request NativeScript#866 from NativeScript/remove-rows/columns-tests
remove rows/columns tests added
2 parents 158046f + 6b42f51 commit fb24c13

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

apps/tests/layouts/grid-layout-tests.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,40 @@ export function test_removeColumn_shouldThrow_onNullValues() {
202202
}, "removeColumn called with null should throw exception");
203203
}
204204

205+
export function test_removeColumns() {
206+
var columns = rootLayout.getColumns();
207+
208+
rootLayout.removeColumns();
209+
210+
TKUnit.assertEqual(rootLayout.getColumns().length, 0);
211+
212+
columns.forEach(c=> rootLayout.addColumn(c));
213+
}
214+
215+
export function test_removeRows() {
216+
var rows = rootLayout.getRows();
217+
218+
rootLayout.removeRows();
219+
220+
TKUnit.assertEqual(rootLayout.getRows().length, 0);
221+
222+
rows.forEach(r=> rootLayout.addRow(r));
223+
}
224+
225+
export function test_removeChildren() {
226+
var children = [];
227+
228+
for (let i = 0; i < rootLayout.getChildrenCount(); i++) {
229+
children.push(rootLayout.getChildAt(i));
230+
}
231+
232+
rootLayout.removeChildren();
233+
234+
TKUnit.assertEqual(rootLayout.getChildrenCount(), 0);
235+
236+
children.forEach(c=> rootLayout.addChild(c));
237+
}
238+
205239
export function test_getRows_shouldNotReturnNULL() {
206240
var rows = rootLayout.getRows();
207241
TKUnit.assert(rows, "getRows should not return null/undefinied");

0 commit comments

Comments
 (0)