Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function ignore_test_DummyTestForSnippetOnly4() {
// >> frame-back
const frame = Frame.topmost();
frame.goBack();
// << frame-back
}
function showReportPage(finalMessage: string) {
const stack = new StackLayout();
const btn = new Button();
btn.text = "Rerun tests";
btn.on("tap", () => runAll(testsSelector));
stack.addChild(btn);
const messageContainer = new TextView();
messageContainer.editable = messageContainer.autocorrect = false;
messageContainer.text = finalMessage;
stack.addChild(messageContainer);
Frame.topmost().navigate({
create: () => {
const page = new Page();
page.content = stack;
messageContainer.focus();
page.style.fontSize = 11;
if (platform.isAndroid) {
page.on('navigatedTo', () => {
messageContainer.focus();
setTimeout(() => messageContainer.dismissSoftInput());
});
}
return page;
},
clearHistory: true
});
export function getCurrentPage(): Page {
return Frame.topmost().currentPage;
}
waitUntilNavigatedFrom(() => topFrame ? topFrame.navigate(entry) : Frame.topmost().navigate(entry));
export function waitUntilNavigatedFrom(action: Function, topFrame?: Frame) {
const currentPage = topFrame ? topFrame.currentPage : Frame.topmost().currentPage;
let completed = false;
function navigatedFrom(args) {
args.object.page.off("navigatedFrom", navigatedFrom);
completed = true;
}
currentPage.on("navigatedFrom", navigatedFrom);
action();
TKUnit.waitUntilReady(() => completed);
}
export function test_page_parent_when_navigate_with_clear_history() {
const frame = Frame.topmost();
const pages = new Array();
const create = () => {
const page = new Page();
pages.push(page);
return page;
};
frame.navigate({ create });
frame.navigate({ create, backstackVisible: false });
frame.navigate({ create });
frame.navigate({ create: () => new Page(), clearHistory: true });
emptyNavigationQueue(frame);
TKUnit.assertEqual(pages.length, 3);
export function buttonTap(args) {
Frame.topmost().goBack();
}
btn2.on("tap", () => {
var nextPage = "app/tests/pages/page16";
Frame.topmost().navigate(nextPage);
});
export function test_page_parent_when_backstackVisible_is_false() {
const frame = Frame.topmost();
const pages = new Array();
const create = () => {
const page = new Page();
pages.push(page);
return page;
};
frame.navigate({ create: () => new Page(), clearHistory: true });
frame.navigate({ create, backstackVisible: false });
frame.navigate(() => new Page());
emptyNavigationQueue(frame);
TKUnit.assertEqual(pages.length, 1);
TKUnit.assertEqual(frame.backStack.length, 1);