(views: Array<View>)
| 4 | |
| 5 | export 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 | } |
no test coverage detected