Skip to content

Commit 2e2467c

Browse files
Hristo HristovHristo Hristov
authored andcommitted
Fixed two android tests to account for small emulator screens and floating density
1 parent 501b954 commit 2e2467c

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎tests/app/ui/layouts/grid-layout-tests.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,10 @@ export class GridLayoutTest extends testModule.UITest<RemovalTrackingGridLayout>
681681
}
682682

683683
public test_columns_widths() {
684-
this.testView.width = { value: 400, unit: "px" };
685-
this.testView.height = { value: 600, unit: "px" };
684+
this.testView.width = { value: 300, unit: "px" };
685+
this.testView.height = { value: 400, unit: "px" };
686686

687-
let grid = new GridLayout();
687+
const grid = new GridLayout();
688688
this.testView.addChild(grid);
689689
grid.horizontalAlignment = "left";
690690
grid.verticalAlignment = "top";
@@ -697,23 +697,23 @@ export class GridLayoutTest extends testModule.UITest<RemovalTrackingGridLayout>
697697
grid.addRow(new ItemSpec(layoutHelper.dp(100), "pixel"));
698698
grid.addRow(new ItemSpec(2, "star"));
699699

700-
let btn = new Button();
701-
btn.width = { value: 300, unit: "px" };
702-
btn.height = { value: 500, unit: "px" };
700+
const btn = new Button();
701+
btn.width = { value: 200, unit: "px" };
702+
btn.height = { value: 300, unit: "px" };
703703
grid.addChild(btn);
704704
GridLayout.setColumnSpan(btn, 3);
705705
GridLayout.setRowSpan(btn, 3);
706706
this.waitUntilTestElementLayoutIsValid();
707707

708708
var cols = grid.getColumns();
709-
TKUnit.assertAreClose(cols[0].actualLength, layoutHelper.dp(67), DELTA, "Column[0] actual length should be 67");
709+
TKUnit.assertAreClose(cols[0].actualLength, layoutHelper.dp(33), DELTA, "Column[0] actual length should be 67");
710710
TKUnit.assertAreClose(cols[1].actualLength, layoutHelper.dp(100), DELTA, "Column[1] actual length should be 100");
711-
TKUnit.assertAreClose(cols[2].actualLength, layoutHelper.dp(133), DELTA, "Column[2] actual length should be 133");
711+
TKUnit.assertAreClose(cols[2].actualLength, layoutHelper.dp(67), DELTA, "Column[2] actual length should be 133");
712712

713713
var rows = grid.getRows();
714-
TKUnit.assertAreClose(rows[0].actualLength, layoutHelper.dp(133), DELTA, "Row[0] actual length should be 133");
714+
TKUnit.assertAreClose(rows[0].actualLength, layoutHelper.dp(67), DELTA, "Row[0] actual length should be 133");
715715
TKUnit.assertAreClose(rows[1].actualLength, layoutHelper.dp(100), DELTA, "Row[1] actual length should be 100");
716-
TKUnit.assertAreClose(rows[2].actualLength, layoutHelper.dp(267), DELTA, "Row[2] actual length should be 267");
716+
TKUnit.assertAreClose(rows[2].actualLength, layoutHelper.dp(133), DELTA, "Row[2] actual length should be 267");
717717
}
718718
}
719719

‎tests/app/ui/scroll-view/scroll-view-tests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class ScrollLayoutTest extends UITest<ScrollView> {
172172
helper.goBack();
173173

174174
// Check horizontalOffset after navigation
175-
TKUnit.assertEqual(this.testView.horizontalOffset, 100, "this.testView.horizontalOffset after navigation");
175+
TKUnit.assertEqual(this.testView.horizontalOffset, offset, "this.testView.horizontalOffset after navigation");
176176
}
177177

178178
public test_scrollView_vertical_raised_scroll_event() {

0 commit comments

Comments
 (0)