chore: fix nav tests with cli next (#6374)

This commit is contained in:
Manol Donev
2018-10-10 15:52:23 +03:00
committed by GitHub
parent 04233b65c1
commit b2246ad089
3 changed files with 12 additions and 14 deletions

View File

@ -146,7 +146,7 @@ export function test_ClearHistory_WithTransition() {
// Test case for https://github.com/NativeScript/NativeScript/issues/1948
export function test_ClearHistoryWithTransitionDoesNotBreakNavigation() {
let topmost = topmostFrame();
let mainTestPage = topmost.currentPage;
let mainTestPage = new Page();
let mainPageFactory = function (): Page {
return mainTestPage;
};

View File

@ -1,17 +1,15 @@
/* tslint:disable */
import * as TKUnit from "./TKUnit";
import { _resetRootView, getRootView } from "tns-core-modules/application";
import { _resetRootView } from "tns-core-modules/application";
import { messageType } from "tns-core-modules/trace";
import { topmost, Frame, NavigationEntry } from "tns-core-modules/ui/frame";
import { topmost, Frame } from "tns-core-modules/ui/frame";
import { Page } from "tns-core-modules/ui/page";
import { TextView } from "tns-core-modules/ui/text-view";
import { Button } from "tns-core-modules/ui/button";
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import * as platform from "tns-core-modules/platform";
import "./ui-test";
import * as fs from "tns-core-modules/file-system";
import { unsetValue } from "tns-core-modules/ui/core/properties";
import { ad, ios } from "tns-core-modules/utils/utils";
import { ios } from "tns-core-modules/utils/utils";
Frame.defaultAnimatedNavigation = false;
@ -148,12 +146,12 @@ if (platform.isIOS && ios.MajorVersion > 10) {
import * as stylePropertiesTests from "./ui/styling/style-properties-tests";
allTests["STYLE-PROPERTIES"] = stylePropertiesTests;
import * as tabViewRootTests from "./ui/tab-view/tab-view-root-tests";
allTests["TAB-VIEW-ROOT"] = tabViewRootTests;
import * as frameTests from "./ui/frame/frame-tests";
allTests["FRAME"] = frameTests;
import * as tabViewRootTests from "./ui/tab-view/tab-view-root-tests";
allTests["TAB-VIEW-ROOT"] = tabViewRootTests;
import * as viewTests from "./ui/view/view-tests";
allTests["VIEW"] = viewTests;

View File

@ -849,7 +849,7 @@ export const testAlignContent_spaceBetween_withPadding = test(
isBottomAlignedWith(text3, flexbox);
isLeftAlignedWith(text3, flexbox);
}
);
);
export const testAlignContent_spaceAround = test(
activity_align_content_test,
@ -862,9 +862,9 @@ export const testAlignContent_spaceAround = test(
let spaceAround = height(flexbox) - height(text1) - height(text3);
spaceAround /= 4; // Divide by the number of flex lines * 2
isBelowWith(flexbox, text1, spaceAround);
isBelowWith(flexbox, text1, Math.ceil(spaceAround));
isBelowWith(text1, text3, height(text1) + 2 * spaceAround);
isAboveWith(text3, flexbox, spaceAround);
isAboveWith(text3, flexbox, Math.ceil(spaceAround));
isAboveWith(text1, text3, height(text3) + 2 * spaceAround);
// TODO: equal(flexbox.getFlexLines().size(), is(2));
@ -992,9 +992,9 @@ export const testAlignContent_spaceAround_flexDirection_column = test(
let spaceAround = width(flexbox) - width(text1) - width(text3);
spaceAround /= 4; // Divide by the number of flex lines * 2
isLeftWith(flexbox, text1, spaceAround);
isLeftWith(flexbox, text1, Math.ceil(spaceAround));
isLeftWith(text1, text3, width(text1) + 2 * spaceAround);
isRightWith(text3, flexbox, spaceAround);
isRightWith(text3, flexbox, Math.ceil(spaceAround));
isRightWith(text1, text3, width(text3) + 2 * spaceAround);
}
);