File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ Revision history for WWW::Mechanize
7
7
- We now consistently use our own die() method and therefore the onerror
8
8
handler wherever possible (GH#80) (Julien Fiegehenn)
9
9
10
+ [TESTS]
11
+ - Add tests for field() when working on a <textarea> (GH#220) (Julien
12
+ Fiegehenn)
13
+
10
14
2.12 2022-07-20 06:45:40Z
11
15
12
16
[ENHANCEMENTS]
Original file line number Diff line number Diff line change 13
13
< input type ="hidden " name ="__value " value >
14
14
< input type ="hidden " name ="__value_empty " value ="">
15
15
< input type ="hidden " name ="__value_full " value ="full ">
16
+ < textarea rows ="5 " cols ="60 " id ="textarea_id " name ="textarea_name "> </ textarea >
16
17
</ FORM >
17
18
</ BODY >
18
19
</ HTML >
Original file line number Diff line number Diff line change 2
2
3
3
use warnings;
4
4
use strict;
5
- use Test::More tests => 14 ;
5
+ use Test::More;
6
6
use URI::file;
7
7
8
8
BEGIN {
@@ -29,6 +29,10 @@ $mech->set_visible( [ radio => 'wongo!' ], 'boingo' );
29
29
is( $mech -> value( ' wango' ), ' wongo!' , ' wango changed' );
30
30
is( $mech -> value( ' dingo' , 2 ), ' boingo' , ' dingo changed' );
31
31
32
+ ok( ! $mech -> value( ' textarea_name' ), ' textarea is empty' );
33
+ $mech -> field( ' textarea_name' => ' foobar' );
34
+ is( $mech -> value( ' textarea_name' ), ' foobar' , ' textarea has been populated' );
35
+
32
36
for my $name (qw/ __no_value __value_empty/ ) {
33
37
ok( ! $mech -> value( $name ), " $name is empty" ) or diag $mech -> field($name );
34
38
$mech -> field( $name , ' foo' );
@@ -42,4 +46,6 @@ for my $name (qw/__value/) {
42
46
}
43
47
$mech -> field( $name , ' foo' );
44
48
is( $mech -> value( $name ), ' foo' , " $name changed" );
45
- }
49
+ }
50
+
51
+ done_testing;
You can’t perform that action at this time.
0 commit comments