From db2f29b4bea2d999d0f3e7398a0ae50d8ac2fd8f Mon Sep 17 00:00:00 2001 From: tgpetrov Date: Fri, 26 Oct 2018 15:18:37 +0300 Subject: [PATCH] test(safe-area): add layoutChanged test --- tests/app/ui/layouts/safe-area-tests.ts | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/app/ui/layouts/safe-area-tests.ts b/tests/app/ui/layouts/safe-area-tests.ts index ec6e7aeca7..befc691387 100644 --- a/tests/app/ui/layouts/safe-area-tests.ts +++ b/tests/app/ui/layouts/safe-area-tests.ts @@ -6,6 +6,8 @@ import * as platform from "tns-core-modules/platform"; import { ios as iosUtils } from "tns-core-modules/utils/utils"; import * as helper from "../helper"; import { parse } from "tns-core-modules/ui/builder"; +import { Page } from "tns-core-modules/ui/page"; +import { Label } from "tns-core-modules/ui/label"; import { dipToDp, left, top, right, bottom, height, width, equal, closeEnough, lessOrCloseEnough, greaterOrCloseEnough, check, @@ -37,6 +39,30 @@ export class SafeAreaTests extends testModule.UITest { // no operation }; + public test_layout_changed_event_count() { + const page = parse(` + + + + + + `); + let gridLayoutChangedCounter = 0; + let labelLayoutChangedCounter = 0; + const grid = page.getViewById("grid"); + grid.on(view.View.layoutChangedEvent, () => { + gridLayoutChangedCounter++; + }); + const label =