Files
NativeScript/apps/app/ui-tests-app/layouts/passThroughParent.ts
Svetoslav 2efafc3a4f test: update test samples (#7016)
* test: update test samples
2019-03-20 18:15:48 +02:00

37 lines
1.3 KiB
TypeScript

import { EventData, Page } from "tns-core-modules/ui/page/page";
import { Label } from "tns-core-modules/ui/label/label";
const setLabelTextAndLog = (args, text: string) => {
const page = <Page>args.object.page;
const label = <Label>page.getViewById("resultLabel");
label.set("text", text);
console.log("on button tap");
}
export function onTap(args: EventData) {
setLabelTextAndLog(args, "onButtonTapResult");
}
export function clearResult(args: EventData) {
setLabelTextAndLog(args, "none");
}
export function onOuterWrapLayoutTap(args) {
setLabelTextAndLog(args, "onOuterWrapLayoutTapResult");
}
export function onStackLayoutThrowTap(args: EventData) {
setLabelTextAndLog(args, "Should not tap layout with IsPassThroughParentEnabled=true");
// throw new Error("Should not tap layout with IsPassThroughParentEnabled=true");
}
export function onUserInteractionDisabledTap(args: EventData) {
setLabelTextAndLog(args, "Should not tap button with IsUserInteractionEnabled=false");
// throw new Error("Should not tap button with IsUserInteractionEnabled=false");
}
export function onDisabledThrowTap(args: EventData) {
setLabelTextAndLog(args, "Should not tap button with IsEnabled=false");
// throw new Error("Should not tap button with IsEnabled=false");
}