| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8a7d672 commit 226ab3c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ import * as platform from "tns-core-modules/platform"; | |||
| 11 | 11 | import "./ui-test"; | |
| 12 | 12 | import * as fs from "tns-core-modules/file-system"; | |
| 13 | 13 | import { unsetValue } from "tns-core-modules/ui/core/properties"; | |
| 14 | - import { ad } from "tns-core-modules/utils/utils"; | ||
| 14 | + import { ad, ios } from "tns-core-modules/utils/utils"; | ||
| 15 | 15 | ||
| 16 | 16 | Frame.defaultAnimatedNavigation = false; | |
| 17 | 17 | ||
@@ -136,7 +136,7 @@ import * as flexBoxLayoutTests from "./ui/layouts/flexbox-layout-tests"; | |||
| 136 | 136 | allTests["FLEXBOXLAYOUT"] = flexBoxLayoutTests; | |
| 137 | 137 | ||
| 138 | 138 | import * as safeAreaLayoutTests from "./ui/layouts/safe-area-tests"; | |
| 139 | - if (platform.device.os === platform.platformNames.ios) { | ||
| 139 | + if (platform.isIOS && ios.MajorVersion > 10) { | ||
| 140 | 140 | allTests["SAFEAREALAYOUT"] = safeAreaLayoutTests; | |
| 141 | 141 | } | |
| 142 | 142 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,16 +79,50 @@ export function do_PageTest_WithStackLayout_AndButton(test: (views: [Page, Stack | |||
| 79 | 79 | newPage.content = null; | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | + export interface PageOptions { | ||
| 83 | + pageCss?: any, | ||
| 84 | + actionBar?: boolean, | ||
| 85 | + actionBarFlat?: boolean, | ||
| 86 | + actionBarHidden?: boolean, | ||
| 87 | + tabBar?: boolean | ||
| 88 | + } | ||
| 89 | + | ||
| 82 | 90 | //export function buildUIAndRunTest(controlToTest, testFunction, options) { | |
| 83 | - export function buildUIAndRunTest<T extends View>(controlToTest: T, testFunction: (views: [T, Page]) => void, options?: {pageCss}) { | ||
| 91 | + export function buildUIAndRunTest<T extends View>(controlToTest: T, testFunction: (views: [T, Page]) => void, options?: PageOptions) { | ||
| 84 | 92 | clearPage(); | |
| 85 | 93 | let newPage = getCurrentPage(); | |
| 86 | 94 | ||
| 95 | + let testSubject = controlToTest as View; | ||
| 96 | + | ||
| 87 | 97 | if (options) { | |
| 88 | - newPage.css = options.pageCss; | ||
| 98 | + if (options.pageCss) { | ||
| 99 | + newPage.css = options.pageCss; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + if (options.actionBar) { | ||
| 103 | + newPage.actionBar.title = "Test"; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + if (options.actionBarFlat) { | ||
| 107 | + newPage.actionBar.title = "Test"; | ||
| 108 | + newPage.actionBar.flat = true; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + if (options.actionBarHidden) { | ||
| 112 | + newPage.actionBarHidden = true; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + if (options.tabBar) { | ||
| 116 | + const tabView = new TabView(); | ||
| 117 | + const tabEntry = new TabViewItem(); | ||
| 118 | + tabEntry.title = "Test"; | ||
| 119 | + tabEntry.view = controlToTest; | ||
| 120 | + tabView.items = [tabEntry]; | ||
| 121 | + testSubject = tabView; | ||
| 122 | + } | ||
| 89 | 123 | } | |
| 90 | 124 | ||
| 91 | - newPage.content = controlToTest; | ||
| 125 | + newPage.content = testSubject; | ||
| 92 | 126 | ||
| 93 | 127 | testFunction([controlToTest, newPage]); | |
| 94 | 128 | newPage.content = null; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments