[Jifty-commit] r4884 - in jifty/branches/jquery/t/TestApp-JiftyJS:
lib/TestApp/JiftyJS
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jan 18 10:01:26 EST 2008
Author: gugod
Date: Fri Jan 18 10:01:26 2008
New Revision: 4884
Modified:
jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm
jifty/branches/jquery/t/TestApp-JiftyJS/t/1-jifty-update.t
Log:
Add more Jifty.update() tests.
Region append, prepend, and deletion are tested.
Modified: jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm (original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm Fri Jan 18 10:01:26 2008
@@ -23,20 +23,16 @@
);
hyperlink(
- id => 'region3',
- label => "John",
+ id => 'region3', label => "John",
onclick => {
region => 'content',
replace_with => 'hello_world',
- args => {
- name => "John"
- }
+ args => { name => "John" }
}
);
hyperlink(
- id => 'region4',
- label => "Smith",
+ id => 'region4', label => "Smith",
onclick => {
region => 'content',
replace_with => 'hello_world',
@@ -46,6 +42,32 @@
}
);
+ hyperlink(
+ id => 'append-region', label => "Append To Region",
+ onclick => {
+ region => "content",
+ append => "hello_world"
+ }
+ );
+
+ hyperlink(
+ id => 'prepend-region', label => "Prepend To Region",
+ onclick => {
+ region => "content",
+ prepend => "hello_world"
+ }
+ );
+
+ hyperlink(
+ id => 'delete-region',
+ label => "Delete Region",
+ onclick => {
+ delete => "content"
+ }
+ );
+
+ hr {};
+
render_region( name => 'content' );
};
Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/1-jifty-update.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/t/1-jifty-update.t (original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/1-jifty-update.t Fri Jan 18 10:01:26 2008
@@ -4,7 +4,7 @@
use warnings;
use lib 't/lib';
use Jifty::SubTest;
-use Jifty::Test tests => 18;
+use Jifty::Test tests => 26;
use Jifty::Test::WWW::Selenium;
use utf8;
@@ -28,8 +28,28 @@
$sel->click_ok("region4");
$sel->wait_for_text_present_ok("Hello, Smith");
+
+ $sel->click_ok("append-region");
+ $sel->wait_for_text_present_ok("Hello, World");
+ my $src = $sel->get_html_source();
+
+ like $src, qr{<p>Hello, Smith</p><div id="region-content-.+">\n<p>Hello, World</p></div>};
+
+ $sel->click_ok("prepend-region");
+ $sel->wait_for_text_present_ok("Hello, World");
+ $src = $sel->get_html_source();
+
+ like $src, qr{<div id="region-content-content-.+">\n<p>Hello, World</p></div>\n<p>Hello, Smith</p><div id="region-content-content-.+">\n<p>Hello, World</p></div>};
+
+ $sel->click_ok("delete-region");
+ $sel->pause();
+
+ ok(! $sel->is_element_present("region-content"), "'content' region is deleted." );
+
}
+
+
{
# One click updates 3 regions, and triggers an alert.
More information about the Jifty-commit
mailing list