mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Merge pull request #866 from NativeScript/remove-rows/columns-tests
remove rows/columns tests added
This commit is contained in:
@ -202,6 +202,40 @@ export function test_removeColumn_shouldThrow_onNullValues() {
|
||||
}, "removeColumn called with null should throw exception");
|
||||
}
|
||||
|
||||
export function test_removeColumns() {
|
||||
var columns = rootLayout.getColumns();
|
||||
|
||||
rootLayout.removeColumns();
|
||||
|
||||
TKUnit.assertEqual(rootLayout.getColumns().length, 0);
|
||||
|
||||
columns.forEach(c=> rootLayout.addColumn(c));
|
||||
}
|
||||
|
||||
export function test_removeRows() {
|
||||
var rows = rootLayout.getRows();
|
||||
|
||||
rootLayout.removeRows();
|
||||
|
||||
TKUnit.assertEqual(rootLayout.getRows().length, 0);
|
||||
|
||||
rows.forEach(r=> rootLayout.addRow(r));
|
||||
}
|
||||
|
||||
export function test_removeChildren() {
|
||||
var children = [];
|
||||
|
||||
for (let i = 0; i < rootLayout.getChildrenCount(); i++) {
|
||||
children.push(rootLayout.getChildAt(i));
|
||||
}
|
||||
|
||||
rootLayout.removeChildren();
|
||||
|
||||
TKUnit.assertEqual(rootLayout.getChildrenCount(), 0);
|
||||
|
||||
children.forEach(c=> rootLayout.addChild(c));
|
||||
}
|
||||
|
||||
export function test_getRows_shouldNotReturnNULL() {
|
||||
var rows = rootLayout.getRows();
|
||||
TKUnit.assert(rows, "getRows should not return null/undefinied");
|
||||
|
Reference in New Issue
Block a user