From 6cc2c6e85f0032a37646942a5b5ee8517ee303d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Fri, 27 Feb 2026 12:31:20 -0300 Subject: [PATCH] Bug 41950: Unit tests for sortable +count embeds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add tests to verify that +count embeds produce +select/+as attributes instead of a prefetch, enabling SQL-level sorting by count columns. Signed-off-by: Tomás Cohen Arazi --- t/Koha/REST/Plugin/Query.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/Koha/REST/Plugin/Query.t b/t/Koha/REST/Plugin/Query.t index e465ecca93..eb278a00d5 100755 --- a/t/Koha/REST/Plugin/Query.t +++ b/t/Koha/REST/Plugin/Query.t @@ -466,7 +466,7 @@ subtest 'dbic_merge_sorting() tests' => sub { }; subtest '/dbic_merge_prefetch' => sub { - plan tests => 10; + plan tests => 11; my $t = Test::Mojo->new; @@ -485,7 +485,10 @@ subtest '/dbic_merge_prefetch' => sub { } ); - $t->get_ok('/dbic_merge_prefetch_count')->status_is(200)->json_is( '/prefetch/0' => 'guarantee' ); + $t->get_ok('/dbic_merge_prefetch_count') + ->status_is(200) + ->json_is( '/+as/0' => 'guarantee_count' ) + ->json_hasnt('/prefetch'); }; subtest '/merge_q_params' => sub { -- 2.50.1 (Apple Git-155)