started to fill out the set_attribute stub
[catagits/HTML-Zoom.git] / t / todo-forms.t
CommitLineData
23ba49c7 1use HTML::Zoom;
2use Test::More;
3
4my $zoom = HTML::Zoom->from_html(<<HTML);
5<form class="myform" action="/somewhere">
6<label />
7<input />
8</form>
9HTML
10
11my @fields = (
12 { id => "foo", label => "foo", name => "foo", type => "text", value => 0 },
13 { id => "bar", label => "bar", name => "bar", type => "radio", value => 1 },
14);
15
16my $h = $zoom->select('.myform')->repeat_content([
17 map { my $field = $_; sub {
18 $_->select('label')
2daa653a 19 ->add_to_attribute( for => $field->{id} )
23ba49c7 20 ->then
21 ->replace_content( $field->{label} )
22 ->select('input')
2daa653a 23 ->add_to_attribute( name => $field->{name} )
23ba49c7 24 ->then
2daa653a 25 ->add_to_attribute( type => $field->{type} )
23ba49c7 26 ->then
2daa653a 27 ->add_to_attribute( value => $field->{value} )
23ba49c7 28 } } @fields
29 ])->to_html;
30
a88c1c57 31warn $h;
32
23ba49c7 33ok 1;
34done_testing;