Bugzilla – Attachment 175917 Details for
Bug 36025
Extended attributes clause added to patron search query even when there are no searchable attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36025: Selenium test for the query parameters
Bug-36025-Selenium-test-for-the-query-parameters.patch (text/plain), 2.63 KB, created by
Nick Clemens (kidclamp)
on 2024-12-23 19:51:32 UTC
(
hide
)
Description:
Bug 36025: Selenium test for the query parameters
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-12-23 19:51:32 UTC
Size:
2.63 KB
patch
obsolete
>From 7fa9115c57b077f90c51e11a336d2bdc0c158b91 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Thu, 8 Feb 2024 01:02:51 +0000 >Subject: [PATCH] Bug 36025: Selenium test for the query parameters > >The test verifies that there is no clause for extended >attributes in the patron search query when no patron >attribute is searchable by default. > >NC amended patch - tidied > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/selenium/patrons_search.t | 43 +++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index b1a1bf7cf1f..8aa1673fa91 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -835,8 +835,49 @@ subtest 'Search patrons in modal' => sub { > ); > }; > >- teardown(); >+ subtest 'no clause for extended_attributes when none are default searchable' => sub { >+ $attribute_type_searchable_1->update( { searched_by_default => 0 } ); >+ $attribute_type_searchable_2->update( { searched_by_default => 0 } ); >+ >+ $driver->get( $base_url . "/members/members-home.pl" ); >+ >+ $driver->execute_script( <<'EOF', 'capture_ajax_data' ); >+jQuery( document ).on( "ajaxSend", function( event, request, settings ) { >+ jQuery('#patron_search_form').after('<div id="capture_ajax_data_was_executed"></div>'); >+ var url = new URL(window.location.origin + settings.url); >+ var parts = url.search.substring(1).split('&'); >+ var q; >+ for (var i = 0 ; i < parts.length ; i++) { >+ var p = parts[i].split('='); >+ if (p[0] === 'q') { >+ q = JSON.parse(decodeURIComponent(p[1])); >+ break; >+ } >+ } >+ >+ for (var i = 0; i < q.length; i++) { >+ var q0 = q[i]['-and']; >+ for (var j = 0; q0 && j < q0.length; j++) { >+ for (var k = 0; k < q0[j].length; k++) { >+ if (q0[j][k].hasOwnProperty('extended_attributes.code')) { >+ jQuery('#patron_search_form').after('<div id="had_extended_attributes_clause"></div>'); >+ } >+ } >+ } >+ } >+} ); >+EOF >+ $s->fill_form( { search_patron_filter => 'test_patron' } ); >+ $s->submit_form; >+ sleep $DT_delay && $s->wait_for_ajax; >+ my $e1 = $driver->find_elements( 'capture_ajax_data_was_executed', 'id' ); >+ is( scalar(@$e1), 1, 'the capture script was executed' ); >+ my $e2 = $driver->find_elements( 'had_extended_attributes_clause', 'id' ); >+ is( scalar(@$e2), 0, 'there were no extended attributes on the search clause' ); > >+ }; >+ >+ teardown(); > }; > > sub is_patron_shown { >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36025
:
161873
|
161874
|
161914
|
161915
|
175917
|
175918
|
175952
|
176747
|
176748
|
176823
|
176824
|
178037
|
178038
|
178039
|
178081
|
178082
|
178083