From c3ba250aa16957de5cf583ee1c6e2d269d686736 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Sun, 22 Jun 2014 14:37:57 +0200 Subject: Added test for ask_fromTreeList --- t/03-Shared_GUI.t | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/t/03-Shared_GUI.t b/t/03-Shared_GUI.t index ce2bf5be..01a5772d 100644 --- a/t/03-Shared_GUI.t +++ b/t/03-Shared_GUI.t @@ -18,7 +18,7 @@ BEGIN { SKIP: { #remember to skip the righ number of tests - skip "You didn't say yes...", 10, unless ( $a eq "y" ); + skip "You didn't say yes...", 11, unless ( $a eq "y" ); ok( $gui->warningMsgBox({text => "Warning message! (no title, no richtext)
line two"}), 'wmb1'); @@ -35,25 +35,34 @@ BEGIN { cmp_ok($btn = $gui->ask_YesOrNo({title => "Question on tests", text => "Did these tests all pass?"}), ">=", 0, 'ask_YesOrNo'); diag "ask_YesOrNo got: < " . ($btn == 1 ? "Yes": "No"). " >"; - + #TODO cancel makes this test failing - ok(my $item = $gui->ask_fromList({title => "Choose from list", header => "Which one do you select?", default_button => 1, - list => ['item 1', 'item 2', 'item 3', 'item 4']}), 'ask_fromList'); + ok(my $item = $gui->ask_fromList({title => "Choose from list", header => "Which one do you select?", default_button => 1, + list => ['item 1', 'item 2', 'item 3', 'item 4']}), 'ask_fromList'); diag "ask_fromList got: < " . ($item ? $item : "none") . " >"; + + #TODO cancel makes this test failing + ok($item = $gui->ask_fromTreeList({title => "Choose from list", header => "Which one do you select?", default_button => 1, + default_item => 'leaf 2', + list => ['item 1/item 2/item 3', 'item 1/item 2/leaf 1', 'item 1/item 2/leaf 2', 'item 4/leaf 3', 'item 5']}), + 'ask_fromTreeList'); + diag "ask_fromTreeList got: < " . ($item ? $item : "none") . " >"; + ok($gui->AboutDialog({ name => "Shared::GUI TABBED", - version => $AdminPanel::Shared::VERSION, - credits => "Copyright (C) 2014 Angelo Naselli", - license => $AdminPanel::Shared::License, - authors => "Angelo Naselli \nMatteo Pasotti ", - }), 'AboutDialog'); + version => $AdminPanel::Shared::VERSION, + credits => "Copyright (C) 2014 Angelo Naselli", + license => 'GPLv2', + authors => "Angelo Naselli \nMatteo Pasotti ", + }), 'AboutDialog'); ok($gui->AboutDialog({ name => "Shared::GUI CLASSIC", - version => $AdminPanel::Shared::VERSION, - credits => "Copyright (C) 2014 Angelo Naselli", - license => $AdminPanel::Shared::License, - authors => "Angelo Naselli \nMatteo Pasotti ", - dialog_mode => 1, - }), 'ClassicAboutDialog'); + version => $AdminPanel::Shared::VERSION, + credits => "Copyright (C) 2014 Angelo Naselli", + license => 'GPLv2', + authors => "Angelo Naselli \nMatteo Pasotti ", + dialog_mode => 1, + }), 'ClassicAboutDialog'); } - + + done_testing; -- cgit v1.2.1