Form/* now all use getOriginalValue and getDefaultValue. This resolves the Layout bug where all the check lists could not be unchecked. Tests were updated, but still need a major overhaul.
This commit is contained in:
parent
96b7047d22
commit
173c2a12cd
42 changed files with 173 additions and 76 deletions
|
|
@ -32,7 +32,7 @@ my $session = WebGUI::Test->session;
|
|||
my $formClass = 'WebGUI::Form::CheckList';
|
||||
my $formType = 'Checkbox';
|
||||
|
||||
my $numTests = 15;
|
||||
my $numTests = 20;
|
||||
|
||||
|
||||
plan tests => $numTests;
|
||||
|
|
@ -99,3 +99,13 @@ is( $inputs[0]->{value},
|
|||
WebGUI::International->new($session,"Form_CheckList")->get("selectAll label"),
|
||||
'The value is internationalized'
|
||||
);
|
||||
|
||||
my $cl = WebGUI::Form::CheckList->new($session, {defaultValue => 'default'});
|
||||
is($cl->getValue(),'default','Check getvalue with null returns default value');
|
||||
is($cl->getValue("value"), "value", "Check getValue returns a value");
|
||||
$cl->set('value',"original");
|
||||
is($cl->getDefaultValue(), "default", "Check getDefaultValue returns the default value");
|
||||
my $c2 = WebGUI::Form::CheckList->new($session, {defaultValue => 'default'});
|
||||
is($c2->getOriginalValue(), "default", "Get original value returns the default value");
|
||||
$c2->set('value',"original");
|
||||
is($c2->getOriginalValue(), "original", "Get original value return original value");
|
||||
|
|
|
|||
|
|
@ -73,7 +73,10 @@ my $input = $inputs[0];
|
|||
|
||||
is($input->name, 'TestDate', 'Checking input name');
|
||||
is($input->type, 'text', 'Checking input type');
|
||||
#is($input->value, $defaultTime, "Checking default value");
|
||||
TODO: {
|
||||
local $TODO = "Figure out why this is returning a MySQL value instead of an epoch.";
|
||||
is($input->value, $defaultTime, "Checking default value");
|
||||
}
|
||||
is($input->{size}, 10, 'Checking size param, default');
|
||||
is($input->{maxlength}, 10, 'Checking maxlength param, default');
|
||||
|
||||
|
|
@ -95,7 +98,7 @@ $html = join "\n",
|
|||
$input = $inputs[0];
|
||||
is($input->name, 'preDateValue', 'Checking input name');
|
||||
TODO: {
|
||||
local $TODO = "Figure out why this is returning a MySQL value instead of an epoch.";
|
||||
local $TODO = "Figure out why this is returning a MySQL value instead of an epoch.";
|
||||
is($input->value, 1217608466, 'Checking default value');
|
||||
}
|
||||
is($input->{size}, 10, 'Checking size param, set');
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ my $html = join "\n",
|
|||
checked => 1,
|
||||
})->toHtml,
|
||||
$footer;
|
||||
use Data::Dumper;
|
||||
|
||||
my @forms = HTML::Form->parse($html, 'http://www.webgui.org');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue