MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / test

Function test

apps/automated/src/ui/view/view-tests-common.ts:6–19  ·  view source on GitHub ↗
(views: Array<View>)

Source from the content-addressed store, hash-verified

4
5export function test_eachDescendant() {
6 const test = function (views: Array<View>) {
7 // traverse the visual tree and verify the hierarchy
8 let counter = 0;
9 const callback = function (child: View): boolean {
10 TKUnit.assert(child === views[counter]);
11 counter++;
12
13 return true;
14 };
15
16 eachDescendant(<any>Frame.topmost(), callback);
17 // Descendants: page, actionBar, button
18 TKUnit.assertEqual(counter, 3, 'descendants');
19 };
20
21 helper.do_PageTest_WithButton(test);
22}

Callers 5

do_PageTestFunction · 0.50
do_PageTest_WithButtonFunction · 0.50
executeSnippetMethod · 0.50
executeSnippetMethod · 0.50

Calls 9

eachDescendantFunction · 0.90
getViewByIdFunction · 0.90
assertMethod · 0.80
indexOfMethod · 0.80
bindMethod · 0.80
onMethod · 0.65
topmostMethod · 0.45
removeChildMethod · 0.45

Tested by

no test coverage detected