View | Details | Raw Unified | Return to bug 29822
Collapse All | Expand All

(-)a/t/db_dependent/selenium/patrons_search.t (-7 / +6 lines)
Lines 163-181 subtest 'Search patrons' => sub { Link Here
163
    $driver->get( $base_url . "/members/members-home.pl" );
163
    $driver->get( $base_url . "/members/members-home.pl" );
164
    my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
164
    my @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
165
    is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.');
165
    is( scalar @adv_options, $nb_standard_fields + 1, 'All standard fields are searchable if DefaultPatronSearchFields not set. middle_name is there.');
166
    is( $adv_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set');
166
    is( $adv_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard search uses hard coded list when DefaultPatronSearchFields not set');
167
    my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
167
    my @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
168
    is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set');
168
    is( scalar @filter_options, $nb_standard_fields + 1, 'All standard fields + middle_name are searchable by filter if DefaultPatronSearchFields not set');
169
    is( $filter_options[0]->get_value(), 'firstname,middle_name,surname,othernames,cardnumber,userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set');
169
    is( $filter_options[0]->get_value(), 'firstname|middle_name|surname|othernames|cardnumber|userid', 'Standard filter uses hard coded list when DefaultPatronSearchFields not set');
170
    C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials");
170
    C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials");
171
    $driver->get( $base_url . "/members/members-home.pl" );
171
    $driver->get( $base_url . "/members/members-home.pl" );
172
    @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
172
    @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
173
    is( scalar @adv_options, $nb_standard_fields, 'New option added when DefaultPatronSearchFields is populated with a field. Note that middle_name disappears, we do not want it if not part of DefaultPatronSearchFields');
173
    is( scalar @adv_options, $nb_standard_fields, 'New option added when DefaultPatronSearchFields is populated with a field. Note that middle_name disappears, we do not want it if not part of DefaultPatronSearchFields');
174
    is( $adv_options[0]->get_value(), 'firstname,initials', 'Standard search uses DefaultPatronSearchFields when populated');
174
    is( $adv_options[0]->get_value(), 'firstname|initials', 'Standard search uses DefaultPatronSearchFields when populated');
175
    @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
175
    @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
176
    is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field');
176
    is( scalar @filter_options, $nb_standard_fields, 'New filter option added when DefaultPatronSearchFields is populated with a field');
177
    is( $filter_options[0]->get_value(), 'firstname,initials', 'Standard filter uses DefaultPatronSearchFields when populated');
177
    is( $filter_options[0]->get_value(), 'firstname|initials', 'Standard filter uses DefaultPatronSearchFields when populated');
178
    C4::Context->set_preference('DefaultPatronSearchFields',"firstname,initials,horses");
178
    C4::Context->set_preference('DefaultPatronSearchFields',"firstname|initials|horses");
179
    $driver->get( $base_url . "/members/members-home.pl" );
179
    $driver->get( $base_url . "/members/members-home.pl" );
180
    @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
180
    @adv_options = $driver->find_elements('//select[@id="searchfieldstype"]/option');
181
    @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
181
    @filter_options = $driver->find_elements('//select[@id="searchfieldstype_filter"]/option');
182
- 

Return to bug 29822