From 3acf65a0a9fa18e875a8e81af38b82938ca270e3 Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Thu, 30 Aug 2018 22:19:32 +0300 Subject: [PATCH] test: delete PAGE.test_percent_margin_support This case has been handled per layout. --- tests/app/ui/page/page-tests-common.ts | 38 -------------------------- 1 file changed, 38 deletions(-) diff --git a/tests/app/ui/page/page-tests-common.ts b/tests/app/ui/page/page-tests-common.ts index 59aab24ce..02dd740ff 100644 --- a/tests/app/ui/page/page-tests-common.ts +++ b/tests/app/ui/page/page-tests-common.ts @@ -1146,41 +1146,3 @@ export function test_percent_width_and_height_support() { TKUnit.assertTrue(PercentLength.equals(testPage.width, "auto")); TKUnit.assertTrue(PercentLength.equals(testPage.height, "auto")); } - -export function test_percent_margin_support() { - const testPage = new Page(); - const gridLayout = new GridLayout(); - const stackLayout = new StackLayout(); - stackLayout.margin = "10%"; - gridLayout.addChild(stackLayout); - testPage.content = gridLayout; - - helper.navigate(() => testPage); - - const parentBounds = gridLayout._getCurrentLayoutBounds(); - const parentWidth = parentBounds.right - parentBounds.left; - const parentHeight = parentBounds.bottom - parentBounds.top; - - const marginLeft = isIOS ? Math.round(parentWidth * 0.1) : Math.floor(parentWidth * 0.1); - const marginTop = isIOS ? Math.round(parentHeight * 0.1) : Math.floor(parentHeight * 0.1); - - let bounds = stackLayout._getCurrentLayoutBounds(); - TKUnit.assertEqual(Math.round(bounds.left), marginLeft, "Stack LEFT position incorrect"); - TKUnit.assertEqual(Math.round(bounds.top), marginTop, "Stack TOP position incorrect"); - TKUnit.assertEqual(Math.round(bounds.bottom - bounds.top), parentHeight - (2 * marginTop), "Stack HEIGHT incorrect"); - TKUnit.assertEqual(Math.round(bounds.right - bounds.left), parentWidth - (2 * marginLeft), "Stack WIDTH incorrect"); - TKUnit.assertEqual(Math.round(bounds.right), parentWidth - marginLeft, "Stack RIGHT position incorrect"); - TKUnit.assertEqual(Math.round(bounds.bottom), parentHeight - marginTop, "Stack BOTTOM position incorrect"); - - //reset values. - stackLayout.margin = "0"; - TKUnit.waitUntilReady(() => stackLayout.isLayoutValid); - - bounds = stackLayout._getCurrentLayoutBounds(); - TKUnit.assertEqual(bounds.left, 0, "Stack LEFT position incorrect"); - TKUnit.assertEqual(bounds.top, 0, "Stack TOP position incorrect"); - TKUnit.assertEqual(bounds.bottom - bounds.top, parentHeight, "Stack HEIGHT incorrect"); - TKUnit.assertEqual(bounds.right - bounds.left, parentWidth, "Stack WIDTH incorrect"); - TKUnit.assertEqual(bounds.right, parentWidth, "Stack RIGHT position incorrect"); - TKUnit.assertEqual(bounds.bottom, parentHeight, "Stack BOTTOM position incorrect"); -}