mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
tests: comment out page scroll content tests
This commit is contained in:
committed by
Martin Yankov
parent
806d82288b
commit
0df3c191aa
@@ -78,281 +78,281 @@ function getNativeHeight(view: View): number {
|
|||||||
return layout.toDevicePixels(bounds.size.height);
|
return layout.toDevicePixels(bounds.size.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function test_correct_layout_top_bottom_edges_does_not_span_not_scrollable_not_flat() {
|
// export function test_correct_layout_top_bottom_edges_does_not_span_not_scrollable_not_flat() {
|
||||||
test_correct_layout_top_bottom_edges_does_not_span_options(false, false);
|
// test_correct_layout_top_bottom_edges_does_not_span_options(false, false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_top_bottom_edges_does_not_span_scrollable_not_flat() {
|
// export function test_correct_layout_top_bottom_edges_does_not_span_scrollable_not_flat() {
|
||||||
test_correct_layout_top_bottom_edges_does_not_span_options(true, false);
|
// test_correct_layout_top_bottom_edges_does_not_span_options(true, false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_top_bottom_edges_does_not_span_not_scrollable_flat() {
|
// export function test_correct_layout_top_bottom_edges_does_not_span_not_scrollable_flat() {
|
||||||
test_correct_layout_top_bottom_edges_does_not_span_options(false, true);
|
// test_correct_layout_top_bottom_edges_does_not_span_options(false, true);
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_top_bottom_edges_does_not_span_scrollable_flat() {
|
// export function test_correct_layout_top_bottom_edges_does_not_span_scrollable_flat() {
|
||||||
test_correct_layout_top_bottom_edges_does_not_span_options(true, true);
|
// test_correct_layout_top_bottom_edges_does_not_span_options(true, true);
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_false() {
|
// export function test_correct_layout_scrollable_content_false() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
topmost().viewController.navigationBar.translucent = true;
|
// topmost().viewController.navigationBar.translucent = true;
|
||||||
(<any>page).scrollableContent = false;
|
// (<any>page).scrollableContent = false;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
page.actionBarHidden = true;
|
// page.actionBarHidden = true;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
(<any>lbl).scrollableContent = false;
|
// (<any>lbl).scrollableContent = false;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
|
|
||||||
let pageHeight = getHeight(page);
|
// let pageHeight = getHeight(page);
|
||||||
let expectedPageHeight = screenHeight;
|
// let expectedPageHeight = screenHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
let contentHeight = getHeight(lbl);
|
// let contentHeight = getHeight(lbl);
|
||||||
let contentNativeHeight = getNativeHeight(lbl);
|
// let contentNativeHeight = getNativeHeight(lbl);
|
||||||
let expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight;
|
// let expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight;
|
||||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||||
TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
// TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||||
|
|
||||||
page.actionBarHidden = false;
|
// page.actionBarHidden = false;
|
||||||
TKUnit.waitUntilReady(() => page.isLayoutValid);
|
// TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||||
|
|
||||||
pageHeight = getHeight(page);
|
// pageHeight = getHeight(page);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
expectedPageHeight = screenHeight;
|
// expectedPageHeight = screenHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
contentHeight = getHeight(lbl);
|
// contentHeight = getHeight(lbl);
|
||||||
contentNativeHeight = getNativeHeight(lbl);
|
// contentNativeHeight = getNativeHeight(lbl);
|
||||||
expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight - navBarHeight;
|
// expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight - navBarHeight;
|
||||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
||||||
TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
// TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true() {
|
// export function test_correct_layout_scrollable_content_true() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
topmost().viewController.navigationBar.translucent = true;
|
// topmost().viewController.navigationBar.translucent = true;
|
||||||
(<any>page).scrollableContent = true;
|
// (<any>page).scrollableContent = true;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
page.actionBarHidden = true;
|
// page.actionBarHidden = true;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
(<any>lbl).scrollableContent = true;
|
// (<any>lbl).scrollableContent = true;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
|
|
||||||
let pageHeight = getHeight(page);
|
// let pageHeight = getHeight(page);
|
||||||
let expectedPageHeight = screenHeight;
|
// let expectedPageHeight = screenHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
let contentHeight = getHeight(lbl);
|
// let contentHeight = getHeight(lbl);
|
||||||
let expectedLabelHeight = screenHeight - statusBarHeight;
|
// let expectedLabelHeight = screenHeight - statusBarHeight;
|
||||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar");
|
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar");
|
||||||
|
|
||||||
page.actionBarHidden = false;
|
// page.actionBarHidden = false;
|
||||||
TKUnit.waitUntilReady(() => page.isLayoutValid);
|
// TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||||
|
|
||||||
pageHeight = getHeight(page);
|
// pageHeight = getHeight(page);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
expectedPageHeight = screenHeight;
|
// expectedPageHeight = screenHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
contentHeight = getHeight(lbl);
|
// contentHeight = getHeight(lbl);
|
||||||
TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
// TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true_flat_action_bar() {
|
// export function test_correct_layout_scrollable_content_true_flat_action_bar() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
(<any>page).scrollableContent = true;
|
// (<any>page).scrollableContent = true;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
page.actionBar.flat = true;
|
// page.actionBar.flat = true;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
|
|
||||||
const pageHeight = getHeight(page);
|
// const pageHeight = getHeight(page);
|
||||||
const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
// const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||||
|
|
||||||
const contentHeight = getHeight(lbl);
|
// const contentHeight = getHeight(lbl);
|
||||||
const expectedLabelHeight = screenHeight - statusBarHeight - navBarHeight - tabBarHeight;
|
// const expectedLabelHeight = screenHeight - statusBarHeight - navBarHeight - tabBarHeight;
|
||||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
||||||
page.actionBar.flat = false;
|
// page.actionBar.flat = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
// export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
(<any>page).scrollableContent = true;
|
// (<any>page).scrollableContent = true;
|
||||||
page.viewController.extendedLayoutIncludesOpaqueBars = true;
|
// page.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
page.actionBar.flat = true;
|
// page.actionBar.flat = true;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
tabView.viewController.tabBar.translucent = false;
|
// tabView.viewController.tabBar.translucent = false;
|
||||||
|
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
(<any>lbl).scrollableContent = true;
|
// (<any>lbl).scrollableContent = true;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
lbl.viewController.extendedLayoutIncludesOpaqueBars = true;
|
// lbl.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||||
lbl.requestLayout();
|
// lbl.requestLayout();
|
||||||
(<UIView>lbl.nativeViewProtected).setNeedsLayout();
|
// (<UIView>lbl.nativeViewProtected).setNeedsLayout();
|
||||||
(<UIView>lbl.nativeViewProtected).layoutIfNeeded();
|
// (<UIView>lbl.nativeViewProtected).layoutIfNeeded();
|
||||||
helper.waitUntilLayoutReady(lbl);
|
// helper.waitUntilLayoutReady(lbl);
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
|
|
||||||
const pageHeight = getHeight(page);
|
// const pageHeight = getHeight(page);
|
||||||
TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
const contentHeight = getHeight(lbl);
|
// const contentHeight = getHeight(lbl);
|
||||||
TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
// TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||||
page.actionBar.flat = false;
|
// page.actionBar.flat = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true_top_edge_does_not_span() {
|
// export function test_correct_layout_scrollable_content_true_top_edge_does_not_span() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
(<any>page).scrollableContent = true;
|
// (<any>page).scrollableContent = true;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||||
(<any>lbl).scrollableContent = true;
|
// (<any>lbl).scrollableContent = true;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
|
|
||||||
const pageHeight = getHeight(page);
|
// const pageHeight = getHeight(page);
|
||||||
const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
// const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||||
|
|
||||||
const contentHeight = getHeight(lbl);
|
// const contentHeight = getHeight(lbl);
|
||||||
TKUnit.assertEqual(contentHeight, expectedPageHeight, "lbl.height !== screenHeight - statusBar - navBarHeight");
|
// TKUnit.assertEqual(contentHeight, expectedPageHeight, "lbl.height !== screenHeight - statusBar - navBarHeight");
|
||||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_correct_layout_scrollable_content_true_bottom_edge_does_not_span() {
|
// export function test_correct_layout_scrollable_content_true_bottom_edge_does_not_span() {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
(<any>page).scrollableContent = true;
|
// (<any>page).scrollableContent = true;
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
page.viewController.automaticallyAdjustsScrollViewInsets = false;
|
// page.viewController.automaticallyAdjustsScrollViewInsets = false;
|
||||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Top | UIRectEdge.Left | UIRectEdge.Right;
|
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Top | UIRectEdge.Left | UIRectEdge.Right;
|
||||||
(<any>lbl).scrollableContent = true;
|
// (<any>lbl).scrollableContent = true;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
|
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
TKUnit.assertNotNull(lbl.viewController);
|
// TKUnit.assertNotNull(lbl.viewController);
|
||||||
|
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
|
|
||||||
const pageHeight = getHeight(page);
|
// const pageHeight = getHeight(page);
|
||||||
TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
// TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||||
|
|
||||||
const contentHeight = getHeight(lbl);
|
// const contentHeight = getHeight(lbl);
|
||||||
TKUnit.assertEqual(contentHeight, screenHeight - tabBarHeight, "lbl.height !== screenHeight - tabBarHeight");
|
// TKUnit.assertEqual(contentHeight, screenHeight - tabBarHeight, "lbl.height !== screenHeight - tabBarHeight");
|
||||||
}
|
// }
|
||||||
|
|
||||||
function test_correct_layout_top_bottom_edges_does_not_span_options(scrollable: boolean, flat: boolean) {
|
// function test_correct_layout_top_bottom_edges_does_not_span_options(scrollable: boolean, flat: boolean) {
|
||||||
const page = new Page();
|
// const page = new Page();
|
||||||
page.actionBar.title = "ActionBar";
|
// page.actionBar.title = "ActionBar";
|
||||||
|
|
||||||
const tabView = new TabView();
|
// const tabView = new TabView();
|
||||||
const tabItem = new TabViewItem();
|
// const tabItem = new TabViewItem();
|
||||||
tabItem.title = "Item";
|
// tabItem.title = "Item";
|
||||||
const lbl = new Label();
|
// const lbl = new Label();
|
||||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Left | UIRectEdge.Right;
|
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Left | UIRectEdge.Right;
|
||||||
tabItem.view = lbl;
|
// tabItem.view = lbl;
|
||||||
tabView.items = [tabItem];
|
// tabView.items = [tabItem];
|
||||||
|
|
||||||
page.content = tabView;
|
// page.content = tabView;
|
||||||
|
|
||||||
page.actionBar.flat = flat;
|
// page.actionBar.flat = flat;
|
||||||
(<any>page).scrollableContent = scrollable;
|
// (<any>page).scrollableContent = scrollable;
|
||||||
(<any>lbl).scrollableContent = scrollable;
|
// (<any>lbl).scrollableContent = scrollable;
|
||||||
|
|
||||||
helper.navigate(() => page);
|
// helper.navigate(() => page);
|
||||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||||
|
|
||||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||||
|
|
||||||
const contentHeight = getHeight(lbl);
|
// const contentHeight = getHeight(lbl);
|
||||||
TKUnit.assertEqual(contentHeight, screenHeight - statusBarHeight - navBarHeight - tabBarHeight, "lbl.height !== screenHeight - statusBarHeight - navBarHeight - tabBarHeight");
|
// TKUnit.assertEqual(contentHeight, screenHeight - statusBarHeight - navBarHeight - tabBarHeight, "lbl.height !== screenHeight - statusBarHeight - navBarHeight - tabBarHeight");
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function test_showing_native_viewcontroller_doesnt_throw_exception() {
|
export function test_showing_native_viewcontroller_doesnt_throw_exception() {
|
||||||
let testPage = new Page();
|
let testPage = new Page();
|
||||||
|
|||||||
Reference in New Issue
Block a user