Skip to content

Commit

Permalink
Update filter logic for Automated=False. Fixes #3841
Browse files Browse the repository at this point in the history
the boolean expression tc[filterBy] was intended to check whether the
requested field exists, as a way to avoid crashes in the case where we
may have forgotten to update the code. However in the case when trying
to search for manual test cases the raw value of this field is `false`
which caused the entire expression to be evaulated as False and did not
apply the filter.
  • Loading branch information
atodorov committed Nov 13, 2024
1 parent d479cce commit bcb7d58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcms/testplans/static/testplans/js/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ function filterTestCasesByProperty (planId, testCases, filterBy, filterValue) {
})
} else {
testCases.filter(function (tc) {
return (tc[filterBy] && tc[filterBy].toString().toLowerCase().indexOf(filterValue) > -1)
return (tc[filterBy] !== undefined && tc[filterBy].toString().toLowerCase().indexOf(filterValue) > -1)
}).forEach(tc => $(`[data-testcase-pk=${tc.id}]`).show())
}
}

0 comments on commit bcb7d58

Please sign in to comment.