From 2532e1a9df8958944c66a3846bbe37cd3840d636 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 1 Oct 2015 14:20:34 +0300 Subject: [PATCH 1/2] remove rows/columns tests added --- apps/tests/layouts/grid-layout-tests.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/tests/layouts/grid-layout-tests.ts b/apps/tests/layouts/grid-layout-tests.ts index 52bbb5efa2..8bbce3e8cf 100644 --- a/apps/tests/layouts/grid-layout-tests.ts +++ b/apps/tests/layouts/grid-layout-tests.ts @@ -202,6 +202,26 @@ 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_getRows_shouldNotReturnNULL() { var rows = rootLayout.getRows(); TKUnit.assert(rows, "getRows should not return null/undefinied"); From 6b42f5188d586b288eaffa94f63ee0ec53d76347 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 1 Oct 2015 14:32:16 +0300 Subject: [PATCH 2/2] test for removeChildren added --- apps/tests/layouts/grid-layout-tests.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/tests/layouts/grid-layout-tests.ts b/apps/tests/layouts/grid-layout-tests.ts index 8bbce3e8cf..301fa0dad9 100644 --- a/apps/tests/layouts/grid-layout-tests.ts +++ b/apps/tests/layouts/grid-layout-tests.ts @@ -222,6 +222,20 @@ export function test_removeRows() { 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");