Skip to content

Commit

Permalink
Merge pull request #6044 from r-richardson/65205_test_filtering_affec…
Browse files Browse the repository at this point in the history
…ted_tables

Have filter options only affect finished jobs
  • Loading branch information
mergify[bot] authored Nov 4, 2024
2 parents c3ef662 + ef80776 commit 9ae638b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/javascripts/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ function renderTestLists() {

// add a handler for the actual filtering
$.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
if (settings.nTable.getAttribute('id') !== 'results') {
return true; // Do not filter other tables
}

var selectedResults = finishedJobsResultFilter.find('option:selected');
// don't apply filter if no result is selected
if (!selectedResults.length) {
Expand Down
13 changes: 13 additions & 0 deletions t/ui/10-tests_overview.t
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,19 @@ 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();

0 comments on commit 9ae638b

Please sign in to comment.