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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
|
||||
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);
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
|
||||
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);
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
|
||||
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);
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
|
||||
export function test_correct_layout_scrollable_content_false() {
|
||||
const page = new Page();
|
||||
topmost().viewController.navigationBar.translucent = true;
|
||||
(<any>page).scrollableContent = false;
|
||||
page.actionBar.title = "ActionBar";
|
||||
page.actionBarHidden = true;
|
||||
// export function test_correct_layout_scrollable_content_false() {
|
||||
// const page = new Page();
|
||||
// topmost().viewController.navigationBar.translucent = true;
|
||||
// (<any>page).scrollableContent = false;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// page.actionBarHidden = true;
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
(<any>lbl).scrollableContent = false;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// (<any>lbl).scrollableContent = false;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// page.content = tabView;
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
|
||||
let pageHeight = getHeight(page);
|
||||
let expectedPageHeight = screenHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
// let pageHeight = getHeight(page);
|
||||
// let expectedPageHeight = screenHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
|
||||
let contentHeight = getHeight(lbl);
|
||||
let contentNativeHeight = getNativeHeight(lbl);
|
||||
let expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight;
|
||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||
TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||
// let contentHeight = getHeight(lbl);
|
||||
// let contentNativeHeight = getNativeHeight(lbl);
|
||||
// let expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight;
|
||||
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||
// TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - tabBar");
|
||||
|
||||
page.actionBarHidden = false;
|
||||
TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||
// page.actionBarHidden = false;
|
||||
// TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||
|
||||
pageHeight = getHeight(page);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
expectedPageHeight = screenHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
// pageHeight = getHeight(page);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// expectedPageHeight = screenHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
|
||||
contentHeight = getHeight(lbl);
|
||||
contentNativeHeight = getNativeHeight(lbl);
|
||||
expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight - navBarHeight;
|
||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
||||
TKUnit.assertEqual(contentNativeHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBarHeight - tabBarHeight - navBarHeight");
|
||||
}
|
||||
// contentHeight = getHeight(lbl);
|
||||
// contentNativeHeight = getNativeHeight(lbl);
|
||||
// expectedLabelHeight = screenHeight - statusBarHeight - tabBarHeight - navBarHeight;
|
||||
// TKUnit.assertEqual(contentHeight, 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() {
|
||||
const page = new Page();
|
||||
topmost().viewController.navigationBar.translucent = true;
|
||||
(<any>page).scrollableContent = true;
|
||||
page.actionBar.title = "ActionBar";
|
||||
page.actionBarHidden = true;
|
||||
// export function test_correct_layout_scrollable_content_true() {
|
||||
// const page = new Page();
|
||||
// topmost().viewController.navigationBar.translucent = true;
|
||||
// (<any>page).scrollableContent = true;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// page.actionBarHidden = true;
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
(<any>lbl).scrollableContent = true;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// (<any>lbl).scrollableContent = true;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// page.content = tabView;
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
|
||||
let pageHeight = getHeight(page);
|
||||
let expectedPageHeight = screenHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
// let pageHeight = getHeight(page);
|
||||
// let expectedPageHeight = screenHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
|
||||
let contentHeight = getHeight(lbl);
|
||||
let expectedLabelHeight = screenHeight - statusBarHeight;
|
||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar");
|
||||
// let contentHeight = getHeight(lbl);
|
||||
// let expectedLabelHeight = screenHeight - statusBarHeight;
|
||||
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar");
|
||||
|
||||
page.actionBarHidden = false;
|
||||
TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||
// page.actionBarHidden = false;
|
||||
// TKUnit.waitUntilReady(() => page.isLayoutValid);
|
||||
|
||||
pageHeight = getHeight(page);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
expectedPageHeight = screenHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
// pageHeight = getHeight(page);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// expectedPageHeight = screenHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight");
|
||||
|
||||
contentHeight = getHeight(lbl);
|
||||
TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||
}
|
||||
// contentHeight = getHeight(lbl);
|
||||
// TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||
// }
|
||||
|
||||
export function test_correct_layout_scrollable_content_true_flat_action_bar() {
|
||||
const page = new Page();
|
||||
(<any>page).scrollableContent = true;
|
||||
page.actionBar.title = "ActionBar";
|
||||
page.actionBar.flat = true;
|
||||
// export function test_correct_layout_scrollable_content_true_flat_action_bar() {
|
||||
// const page = new Page();
|
||||
// (<any>page).scrollableContent = true;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// page.actionBar.flat = true;
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// page.content = tabView;
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
|
||||
const pageHeight = getHeight(page);
|
||||
const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||
// const pageHeight = getHeight(page);
|
||||
// const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||
|
||||
const contentHeight = getHeight(lbl);
|
||||
const expectedLabelHeight = screenHeight - statusBarHeight - navBarHeight - tabBarHeight;
|
||||
TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
||||
page.actionBar.flat = false;
|
||||
}
|
||||
// const contentHeight = getHeight(lbl);
|
||||
// const expectedLabelHeight = screenHeight - statusBarHeight - navBarHeight - tabBarHeight;
|
||||
// TKUnit.assertEqual(contentHeight, expectedLabelHeight, "lbl.height !== screenHeight - statusBar - navBarHeight - tabBarHeight");
|
||||
// page.actionBar.flat = false;
|
||||
// }
|
||||
|
||||
export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
||||
const page = new Page();
|
||||
(<any>page).scrollableContent = true;
|
||||
page.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||
page.actionBar.title = "ActionBar";
|
||||
page.actionBar.flat = true;
|
||||
// export function test_correct_layout_scrollable_content_true_flat_action_bar_edges_span_under_opaque_bars() {
|
||||
// const page = new Page();
|
||||
// (<any>page).scrollableContent = true;
|
||||
// page.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// page.actionBar.flat = true;
|
||||
|
||||
const tabView = new TabView();
|
||||
tabView.viewController.tabBar.translucent = false;
|
||||
// const tabView = new TabView();
|
||||
// tabView.viewController.tabBar.translucent = false;
|
||||
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
(<any>lbl).scrollableContent = true;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// (<any>lbl).scrollableContent = true;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// page.content = tabView;
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
lbl.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||
lbl.requestLayout();
|
||||
(<UIView>lbl.nativeViewProtected).setNeedsLayout();
|
||||
(<UIView>lbl.nativeViewProtected).layoutIfNeeded();
|
||||
helper.waitUntilLayoutReady(lbl);
|
||||
// lbl.viewController.extendedLayoutIncludesOpaqueBars = true;
|
||||
// lbl.requestLayout();
|
||||
// (<UIView>lbl.nativeViewProtected).setNeedsLayout();
|
||||
// (<UIView>lbl.nativeViewProtected).layoutIfNeeded();
|
||||
// helper.waitUntilLayoutReady(lbl);
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
|
||||
const pageHeight = getHeight(page);
|
||||
TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||
// const pageHeight = getHeight(page);
|
||||
// TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||
|
||||
const contentHeight = getHeight(lbl);
|
||||
TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||
page.actionBar.flat = false;
|
||||
}
|
||||
// const contentHeight = getHeight(lbl);
|
||||
// TKUnit.assertEqual(contentHeight, screenHeight, "lbl.height !== screenHeight");
|
||||
// page.actionBar.flat = false;
|
||||
// }
|
||||
|
||||
export function test_correct_layout_scrollable_content_true_top_edge_does_not_span() {
|
||||
const page = new Page();
|
||||
(<any>page).scrollableContent = true;
|
||||
page.actionBar.title = "ActionBar";
|
||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||
// export function test_correct_layout_scrollable_content_true_top_edge_does_not_span() {
|
||||
// const page = new Page();
|
||||
// (<any>page).scrollableContent = true;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||
(<any>lbl).scrollableContent = true;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Bottom | UIRectEdge.Left | UIRectEdge.Right;
|
||||
// (<any>lbl).scrollableContent = true;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// page.content = tabView;
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
|
||||
const pageHeight = getHeight(page);
|
||||
const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||
TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||
// const pageHeight = getHeight(page);
|
||||
// const expectedPageHeight = screenHeight - statusBarHeight - navBarHeight;
|
||||
// TKUnit.assertEqual(pageHeight, expectedPageHeight, "page.height !== screenHeight - statusBar - navBarHeight");
|
||||
|
||||
const contentHeight = getHeight(lbl);
|
||||
TKUnit.assertEqual(contentHeight, expectedPageHeight, "lbl.height !== screenHeight - statusBar - navBarHeight");
|
||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||
}
|
||||
// const contentHeight = getHeight(lbl);
|
||||
// TKUnit.assertEqual(contentHeight, expectedPageHeight, "lbl.height !== screenHeight - statusBar - navBarHeight");
|
||||
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||
// }
|
||||
|
||||
export function test_correct_layout_scrollable_content_true_bottom_edge_does_not_span() {
|
||||
const page = new Page();
|
||||
(<any>page).scrollableContent = true;
|
||||
page.actionBar.title = "ActionBar";
|
||||
page.viewController.automaticallyAdjustsScrollViewInsets = false;
|
||||
(<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||
// export function test_correct_layout_scrollable_content_true_bottom_edge_does_not_span() {
|
||||
// const page = new Page();
|
||||
// (<any>page).scrollableContent = true;
|
||||
// page.actionBar.title = "ActionBar";
|
||||
// page.viewController.automaticallyAdjustsScrollViewInsets = false;
|
||||
// (<UIViewController>page.viewController).edgesForExtendedLayout = UIRectEdge.All;
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Top | UIRectEdge.Left | UIRectEdge.Right;
|
||||
(<any>lbl).scrollableContent = true;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
page.content = tabView;
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Top | UIRectEdge.Left | UIRectEdge.Right;
|
||||
// (<any>lbl).scrollableContent = true;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
// page.content = tabView;
|
||||
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
TKUnit.assertNotNull(lbl.viewController);
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// TKUnit.assertNotNull(lbl.viewController);
|
||||
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
|
||||
const pageHeight = getHeight(page);
|
||||
TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||
// const pageHeight = getHeight(page);
|
||||
// TKUnit.assertEqual(pageHeight, screenHeight, "page.height !== screenHeight");
|
||||
|
||||
const contentHeight = getHeight(lbl);
|
||||
TKUnit.assertEqual(contentHeight, screenHeight - tabBarHeight, "lbl.height !== screenHeight - tabBarHeight");
|
||||
}
|
||||
// const contentHeight = getHeight(lbl);
|
||||
// TKUnit.assertEqual(contentHeight, screenHeight - tabBarHeight, "lbl.height !== screenHeight - tabBarHeight");
|
||||
// }
|
||||
|
||||
function test_correct_layout_top_bottom_edges_does_not_span_options(scrollable: boolean, flat: boolean) {
|
||||
const page = new Page();
|
||||
page.actionBar.title = "ActionBar";
|
||||
// function test_correct_layout_top_bottom_edges_does_not_span_options(scrollable: boolean, flat: boolean) {
|
||||
// const page = new Page();
|
||||
// page.actionBar.title = "ActionBar";
|
||||
|
||||
const tabView = new TabView();
|
||||
const tabItem = new TabViewItem();
|
||||
tabItem.title = "Item";
|
||||
const lbl = new Label();
|
||||
lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
lbl.viewController.edgesForExtendedLayout = UIRectEdge.Left | UIRectEdge.Right;
|
||||
tabItem.view = lbl;
|
||||
tabView.items = [tabItem];
|
||||
// const tabView = new TabView();
|
||||
// const tabItem = new TabViewItem();
|
||||
// tabItem.title = "Item";
|
||||
// const lbl = new Label();
|
||||
// lbl.viewController = iosView.UILayoutViewController.initWithOwner(new WeakRef(lbl));
|
||||
// lbl.viewController.edgesForExtendedLayout = UIRectEdge.Left | UIRectEdge.Right;
|
||||
// tabItem.view = lbl;
|
||||
// tabView.items = [tabItem];
|
||||
|
||||
page.content = tabView;
|
||||
// page.content = tabView;
|
||||
|
||||
page.actionBar.flat = flat;
|
||||
(<any>page).scrollableContent = scrollable;
|
||||
(<any>lbl).scrollableContent = scrollable;
|
||||
// page.actionBar.flat = flat;
|
||||
// (<any>page).scrollableContent = scrollable;
|
||||
// (<any>lbl).scrollableContent = scrollable;
|
||||
|
||||
helper.navigate(() => page);
|
||||
TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
// helper.navigate(() => page);
|
||||
// TKUnit.assertTrue(page.isLoaded, "page NOT loaded!");
|
||||
|
||||
const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
// const statusBarHeight = uiUtils.ios.getStatusBarHeight(page.viewController);
|
||||
// const tabBarHeight = uiUtils.ios.getActualHeight(tabView.viewController.tabBar);
|
||||
// const screenHeight = layout.toDevicePixels(UIScreen.mainScreen.bounds.size.height);
|
||||
// const navBarHeight = uiUtils.ios.getActualHeight(page.frame.ios.controller.navigationBar);
|
||||
|
||||
const contentHeight = getHeight(lbl);
|
||||
TKUnit.assertEqual(contentHeight, screenHeight - statusBarHeight - navBarHeight - tabBarHeight, "lbl.height !== screenHeight - statusBarHeight - navBarHeight - tabBarHeight");
|
||||
}
|
||||
// const contentHeight = getHeight(lbl);
|
||||
// TKUnit.assertEqual(contentHeight, screenHeight - statusBarHeight - navBarHeight - tabBarHeight, "lbl.height !== screenHeight - statusBarHeight - navBarHeight - tabBarHeight");
|
||||
// }
|
||||
|
||||
export function test_showing_native_viewcontroller_doesnt_throw_exception() {
|
||||
let testPage = new Page();
|
||||
|
||||
Reference in New Issue
Block a user