Skip to content

remove rows/columns tests added #866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions apps/tests/layouts/grid-layout-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down