From 817cdacb160d2536e08764a6e5fac08e3d08b756 Mon Sep 17 00:00:00 2001 From: "robert.richardson" Date: Thu, 7 Nov 2024 16:42:58 +0100 Subject: [PATCH] Move finished jobs filter subtest to correct file This commit moves the subtest `result filter does not affect scheduled and running jobs` to t/ui/01-list.t, which tests the /tests page. --- t/ui/01-list.t | 13 +++++++++++++ t/ui/10-tests_overview.t | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/t/ui/01-list.t b/t/ui/01-list.t index b772dd2c19f..6dbe60c6785 100644 --- a/t/ui/01-list.t +++ b/t/ui/01-list.t @@ -426,6 +426,19 @@ subtest 'filter-finished' => sub { cmp_ok scalar $driver->find_elements('#results tbody tr', 'css'), '>', scalar @jobs, 'all jobs shown again'; }; +subtest 'result filter does not affect scheduled and running jobs' => sub { + $driver->get('/tests?resultfilter=Failed'); + + my @running_jobs = $driver->find_elements('#running tbody tr'); + is scalar @running_jobs, 3, 'Running jobs are displayed'; + + my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr'); + is scalar @scheduled_jobs, 3, 'Scheduled jobs are displayed'; + + my @finished_jobs = $driver->find_elements('#results tbody tr'); + is scalar @finished_jobs, 3, 'Finished jobs table is correctly filtered'; +}; + subtest 'match parameter' => sub { $driver->get('/tests?match=staging_e'); wait_for_ajax msg => '"All tests" with match parameter'; diff --git a/t/ui/10-tests_overview.t b/t/ui/10-tests_overview.t index a69ff12fb11..cec108b758d 100644 --- a/t/ui/10-tests_overview.t +++ b/t/ui/10-tests_overview.t @@ -623,19 +623,6 @@ subtest "job dependencies displayed on 'Test result overview' page" => sub { 'parent job was highlighted correctly'; }; -subtest 'result filter does not affect scheduled and running jobs' => sub { - $driver->get('/tests?resultfilter=Failed'); - - my @running_jobs = $driver->find_elements('#running tbody tr'); - is scalar @running_jobs, 2, 'Running jobs are displayed'; - - my @scheduled_jobs = $driver->find_elements('#scheduled tbody tr'); - is scalar @scheduled_jobs, 4, 'Scheduled jobs are displayed'; - - my @finished_jobs = $driver->find_elements('#results tbody tr'); - is scalar @finished_jobs, 6, 'Finished jobs table is correctly filtered'; -}; - kill_driver(); done_testing();