diff options
Diffstat (limited to 't/app/controller')
| -rw-r--r-- | t/app/controller/report_display.t | 49 | 
1 files changed, 49 insertions, 0 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 1f857a387..746f68cf6 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -119,6 +119,55 @@ subtest "test a good report" => sub {      is $update_form->value($_), $fields{$_}, "$_ value" for keys %fields;  }; +for my $test (  +    { +        state => 'confirmed', +        display => 1, +    }, +    { +        state => 'investigating', +        display => 1, +    }, +    { +        state => 'planned', +        display => 1, +    }, +    { +        state => 'in progress', +        display => 1, +    }, +    { +        state => 'fixed', +        display => 0, +    }, +    { +        state => 'fixed - council', +        display => 0, +    }, +    { +        state => 'fixed - user', +        display => 0, +    }, +    { +        state => 'will not fix', +        display => 0, +    }, +) { +    subtest "check fixed checkbox display for state $test->{state}" => sub { +        $report->state( $test->{state} ); +        $report->update; +        $mech->get_ok("/report/$report_id"); + +        my $update_form = $mech->form_name('updateForm'); + +        if ( $test->{display} ) { +            ok defined $update_form->find_input('#form_fixed', 'checkbox'), "fixed checkbox display"; +        } else { +            is $update_form->find_input('#form_fixed', 'checkbox'), undef, "fixed checkbox display"; +        } +    }; +} +  foreach my $meta (      {          anonymous => 'f',  | 
