|
1 | | -import { Page } from "tns-core-modules/ui/page"; |
2 | | -import { GridLayout, ItemSpec } from "tns-core-modules/ui/layouts/grid-layout"; |
3 | | -import { Button } from "tns-core-modules/ui/button"; |
| 1 | +import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; |
4 | 2 | import * as TKUnit from "../../TKUnit"; |
5 | 3 | import * as view from "tns-core-modules/ui/core/view"; |
6 | | -import { unsetValue } from "tns-core-modules/ui/core/view"; |
7 | | -import * as builder from "tns-core-modules/ui/builder"; |
8 | 4 | import * as testModule from "../../ui-test"; |
9 | | -import * as layoutHelper from "./layout-helper"; |
10 | 5 | import * as platform from "tns-core-modules/platform"; |
11 | 6 | import { ios as iosUtils } from "tns-core-modules/utils/utils"; |
12 | | -import * as commonTests from "./common-layout-tests"; |
13 | 7 | import * as helper from "../helper"; |
14 | 8 | import { parse } from "tns-core-modules/ui/builder"; |
15 | 9 | import { |
16 | 10 | dipToDp, left, top, right, bottom, height, width, |
17 | | - paddingLeft, paddingTop, paddingRight, paddingBottom, |
18 | | - equal, closeEnough, notEqual, check, |
19 | | - heightEqual, widthEqual, |
| 11 | + equal, closeEnough, lessOrCloseEnough, check, |
20 | 12 | isLeftAlignedWith, isRightAlignedWith, isTopAlignedWith, isBottomAlignedWith, |
21 | | - isLeftOf, isRightOf, isBelow, isAbove, |
22 | 13 | isLeftWith, isAboveWith, isRightWith, isBelowWith |
23 | 14 | } from "./layout-tests-helper"; |
24 | 15 |
|
@@ -960,12 +951,12 @@ export class SafeAreaTests extends testModule.UITest<any> { |
960 | 951 | isAboveWith(cells[2][2], grid, insets.bottom); |
961 | 952 |
|
962 | 953 | closeEnough(height(cells[0][1]), height(cells[1][1]), `cell height should be equal - cell01<${height(cells[0][1])}> - cell11<${height(cells[1][1])}>`); |
963 | | - equal(height(cells[1][1]), height(cells[2][1]), `cell height should be equal - cell11<${height(cells[1][1])}> - cell21<${height(cells[2][1])}>`); |
| 954 | + closeEnough(height(cells[1][1]), height(cells[2][1]), `cell height should be equal - cell11<${height(cells[1][1])}> - cell21<${height(cells[2][1])}>`); |
964 | 955 | const sumOfLabelHeightAndInsets = insets.top + height(cells[0][1]) + height(cells[1][1]) + height(cells[2][1]) + insets.bottom; |
965 | 956 | closeEnough(height(grid), sumOfLabelHeightAndInsets, `grid height<${height(grid)}> sum of labels height and insets<${sumOfLabelHeightAndInsets}>`); |
966 | 957 |
|
967 | | - equal(width(cells[1][0]), width(cells[1][1]), `cell width should be equal - cell10<${width(cells[1][0])}> - cell11<${width(cells[1][1])}>`); |
968 | | - equal(width(cells[1][1]), width(cells[1][2]), `cell width should be equal - cell11<${width(cells[1][1])}> - cell12<${width(cells[1][2])}>`); |
| 958 | + closeEnough(width(cells[1][0]), width(cells[1][1]), `cell width should be equal - cell10<${width(cells[1][0])}> - cell11<${width(cells[1][1])}>`); |
| 959 | + closeEnough(width(cells[1][1]), width(cells[1][2]), `cell width should be equal - cell11<${width(cells[1][1])}> - cell12<${width(cells[1][2])}>`); |
969 | 960 | const sumOfLabelWidthsAndInsets = insets.left + width(cells[1][0]) + width(cells[1][1]) + width(cells[1][2]) + insets.right; |
970 | 961 | equal(width(grid), sumOfLabelWidthsAndInsets, `grid width<${width(grid)}> sum of nested grids width and insets<${sumOfLabelWidthsAndInsets}>`); |
971 | 962 | }, |
@@ -1021,7 +1012,7 @@ export class SafeAreaTests extends testModule.UITest<any> { |
1021 | 1012 | isBottomAlignedWith(grid, cells[2][2]); |
1022 | 1013 |
|
1023 | 1014 | check(height(cells[0][1]) >= height(cells[1][1]), `cell01 height<${height(cells[0][1])}> not greater or equal cell11 height<${height(cells[1][1])}>`); |
1024 | | - check(height(cells[1][1]) <= height(cells[2][1]), `cell11 height<${height(cells[1][1])}> not less or equal cell21 height<${height(cells[2][1])}>`); |
| 1015 | + lessOrCloseEnough(height(cells[1][1]), height(cells[2][1]), `cell11 height<${height(cells[1][1])}> not less or equal cell21 height<${height(cells[2][1])}>`); |
1025 | 1016 | const sumOfNestedGridHeights = height(cells[0][1]) + height(cells[1][1]) + height(cells[2][1]); |
1026 | 1017 | equal(height(grid), sumOfNestedGridHeights, `grid height<${height(grid)}> sum of nested grids height <${sumOfNestedGridHeights}>`); |
1027 | 1018 |
|
|
0 commit comments