MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / prepareTest

Function prepareTest

apps/automated/src/ui/animation/animation-tests.ts:9–27  ·  view source on GitHub ↗
(parentHeight?: number, parentWidth?: number)

Source from the content-addressed store, hash-verified

7// << animation-require
8
9function prepareTest(parentHeight?: number, parentWidth?: number): Label {
10 let mainPage = helper.getCurrentPage();
11 let label = new Label();
12 label.text = 'label';
13
14 let stackLayout = new StackLayout();
15 // optionally size the parent extent to make assertions about percentage values
16 if (parentHeight !== undefined) {
17 stackLayout.height = PercentLength.parse(parentHeight + '');
18 }
19 if (parentWidth !== undefined) {
20 stackLayout.width = PercentLength.parse(parentWidth + '');
21 }
22 stackLayout.addChild(label);
23 mainPage.content = stackLayout;
24 TKUnit.waitUntilReady(() => label.isLoaded);
25
26 return label;
27}
28
29export function test_AnimatingProperties(done) {
30 let label = prepareTest();

Calls 2

parseMethod · 0.65
addChildMethod · 0.45

Tested by

no test coverage detected