FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: fix nav tests with cli next (#6374) · NativeScript/NativeScript@b2246ad · GitHub

Commit b2246ad

Browse files
authored
chore: fix nav tests with cli next (#6374)
1 parent 04233b6 commit b2246ad

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

‎tests/app/navigation/navigation-tests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function test_ClearHistory_WithTransition() {
146146
// Test case for https://github.com/NativeScript/NativeScript/issues/1948
147147
export function test_ClearHistoryWithTransitionDoesNotBreakNavigation() {
148148
let topmost = topmostFrame();
149-
let mainTestPage = topmost.currentPage;
149+
let mainTestPage = new Page();
150150
let mainPageFactory = function (): Page {
151151
return mainTestPage;
152152
};

‎tests/app/testRunner.ts‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/* tslint:disable */
22
import * as TKUnit from "./TKUnit";
3-
import { _resetRootView, getRootView } from "tns-core-modules/application";
3+
import { _resetRootView } from "tns-core-modules/application";
44
import { messageType } from "tns-core-modules/trace";
5-
import { topmost, Frame, NavigationEntry } from "tns-core-modules/ui/frame";
5+
import { topmost, Frame } from "tns-core-modules/ui/frame";
66
import { Page } from "tns-core-modules/ui/page";
77
import { TextView } from "tns-core-modules/ui/text-view";
88
import { Button } from "tns-core-modules/ui/button";
99
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
1010
import * as platform from "tns-core-modules/platform";
1111
import "./ui-test";
12-
import * as fs from "tns-core-modules/file-system";
13-
import { unsetValue } from "tns-core-modules/ui/core/properties";
14-
import { ad, ios } from "tns-core-modules/utils/utils";
12+
import { ios } from "tns-core-modules/utils/utils";
1513

1614
Frame.defaultAnimatedNavigation = false;
1715

@@ -148,12 +146,12 @@ if (platform.isIOS && ios.MajorVersion > 10) {
148146
import * as stylePropertiesTests from "./ui/styling/style-properties-tests";
149147
allTests["STYLE-PROPERTIES"] = stylePropertiesTests;
150148

151-
import * as tabViewRootTests from "./ui/tab-view/tab-view-root-tests";
152-
allTests["TAB-VIEW-ROOT"] = tabViewRootTests;
153-
154149
import * as frameTests from "./ui/frame/frame-tests";
155150
allTests["FRAME"] = frameTests;
156151

152+
import * as tabViewRootTests from "./ui/tab-view/tab-view-root-tests";
153+
allTests["TAB-VIEW-ROOT"] = tabViewRootTests;
154+
157155
import * as viewTests from "./ui/view/view-tests";
158156
allTests["VIEW"] = viewTests;
159157

‎tests/app/ui/layouts/flexbox-layout-tests.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ export const testAlignContent_spaceBetween_withPadding = test(
849849
isBottomAlignedWith(text3, flexbox);
850850
isLeftAlignedWith(text3, flexbox);
851851
}
852-
);
852+
);
853853

854854
export const testAlignContent_spaceAround = test(
855855
activity_align_content_test,
@@ -862,9 +862,9 @@ export const testAlignContent_spaceAround = test(
862862
let spaceAround = height(flexbox) - height(text1) - height(text3);
863863
spaceAround /= 4; // Divide by the number of flex lines * 2
864864

865-
isBelowWith(flexbox, text1, spaceAround);
865+
isBelowWith(flexbox, text1, Math.ceil(spaceAround));
866866
isBelowWith(text1, text3, height(text1) + 2 * spaceAround);
867-
isAboveWith(text3, flexbox, spaceAround);
867+
isAboveWith(text3, flexbox, Math.ceil(spaceAround));
868868
isAboveWith(text1, text3, height(text3) + 2 * spaceAround);
869869

870870
// TODO: equal(flexbox.getFlexLines().size(), is(2));
@@ -992,9 +992,9 @@ export const testAlignContent_spaceAround_flexDirection_column = test(
992992

993993
let spaceAround = width(flexbox) - width(text1) - width(text3);
994994
spaceAround /= 4; // Divide by the number of flex lines * 2
995-
isLeftWith(flexbox, text1, spaceAround);
995+
isLeftWith(flexbox, text1, Math.ceil(spaceAround));
996996
isLeftWith(text1, text3, width(text1) + 2 * spaceAround);
997-
isRightWith(text3, flexbox, spaceAround);
997+
isRightWith(text3, flexbox, Math.ceil(spaceAround));
998998
isRightWith(text1, text3, width(text3) + 2 * spaceAround);
999999
}
10001000
);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL