1use strict;
2use warnings;
3
4use Test::More tests => 4;
5
6use HTML::FormFu;
7
8my $form = HTML::FormFu->new(
9    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
10
11$form->load_config_file(
12    't/nested/elements/block_repeatable_multi_named_filter.yml');
13
14my $fieldset   = $form->get_element;
15my $repeatable = $fieldset->get_element;
16my $multi      = $repeatable->get_element;
17
18$form->process(
19    {   'counter'            => 1,
20        'nested_1.foo'       => 'aaa',
21        'nested_1.multi.bar' => 'bbb',
22        'nested_1.multi.baz' => 'ccc',
23    } );
24
25ok( $form->submitted_and_valid );
26
27is_deeply(
28    $form->params,
29    {   nested_1 => {
30            foo   => 'aaa',
31            multi => 'bbb ccc'
32        } } );
33
34is( $form->param_value('nested_1.foo'),   'aaa' );
35is( $form->param_value('nested_1.multi'), 'bbb ccc' );
36