From 19aa2b854e7b5373a8ad197abe42d60f8237bd47 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Thu, 2 Nov 2006 03:01:32 +0000 Subject: [PATCH] merge tests from branch into HEAD --- t/Asset/Snippet.t | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/t/Asset/Snippet.t b/t/Asset/Snippet.t index 0bbcd13f9..455f3ff3d 100644 --- a/t/Asset/Snippet.t +++ b/t/Asset/Snippet.t @@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 10; # increment this value for each test you create +use Test::More tests => 12; # increment this value for each test you create use WebGUI::Asset::Snippet; my $session = WebGUI::Test->session; @@ -41,11 +41,27 @@ foreach my $property (keys %{$properties}) { is ($snippet->get($property), $properties->{$property}, "updated $property is ".$properties->{$property}); } +# Test the getToolbar method +for (1..2) { + my $toolbarState = $snippet->getToolbarState; + my $toolbar = $snippet->getToolbar; + is($toolbar, undef, 'getToolbar method returns undef when _toolbarState is set') if $toolbarState; + isnt($toolbar, undef, 'getToolbar method returns something other than undef when _toolbarState is not set') unless $toolbarState; + $snippet->toggleToolbar; +} + +# Rudimentry test of the view method +my $output = $snippet->view; + +# It should return something +isnt ($output, undef, 'view method returns something'); + +# What about our snippet? +ok ($output =~ /Gooey's milkshake brings all the girls to the yard\.\.\./, 'view method output has our snippet in it'); + TODO: { local $TODO = "Tests to make later"; - ok(0, 'Test getToolbar method'); ok(0, 'Test indexContent method'); - ok(0, 'Test view method'); ok(0, 'Test www_edit method'); ok(0, 'Test www_view method... maybe?'); }