Subject: | insert_after says "position element not found" |
Hi,
I just attached a bug report written using Test::More.
It tests finding an element in an existing form, then creating a new
element, and insert_after the element which was just found.
Please confirm.
--
Your bugs , they are afraid of me.
Subject: | bug.pl |
use strict;
use warnings;
use HTML::FormFu;
use Data::Dumper;
use Test::More;
my $f = HTML::FormFu->new;
if($HTML::FormFu::VERSION ne "0.09002") {
die "\n\nERROR: Sorry, this bug report was intended only for version 0.09002\n\n";
};
$f->load_config_file("register.yml");
#print $f;
my $found_element = $f->get_all_element({name=>"captcha" });
is($found_element,"<div class=\"text label\">
<label>Please verify this captcha</label>
<input name=\"captcha\" type=\"text\" />
</div>",
"element found succefuly");
my $new_element = $f->element({
type=>"Block",
name=>"captchaimg",
tag=>"div",
content_xml=>"<img src=\"\"/>",
})->clone;
is($new_element,"<div>
<img src=\"\"/>
</div>","new element constructed succesfuly");
eval {
$f->insert_after($new_element,$found_element);
};
is($@,"","insert_after should work properly now");
Subject: | register.yml |
---
action: /login
indicator: submit
auto_fieldset: 1
elements:
- type: Text
name: username
label: username
constraints:
- Required
- type: Password
name: password
label: password
constraints:
- Required
- type: Password
name: confirmpw
label: Confirm password
constraints:
- Required
- type: Text
name: captcha
label: Please verify this captcha
constraints:
- Required
- type: Submit
value: submit
name: submit
constraints:
- SingleValue