MINOR - Fix Empty Test Suites list filter (#14546)

* MINOR - Fix Empty Test Suites list filter

* allowed empty test suite to appear in logical test suite page

---------

Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
Pere Miquel Brull 2024-01-04 14:57:37 +01:00 committed by GitHub
parent 277ef6b57d
commit d16980a30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ public class ListFilter {
}
if (Boolean.TRUE.equals(DatasourceConfig.getInstance().isMySQL())) {
return "!JSON_CONTAINS(json, JSON_ARRAY() , '$.testCaseResultSummary')";
return "JSON_LENGTH(JSON_EXTRACT(json, '$.testCaseResultSummary')) != 0";
}
return "jsonb_array_length(json#>'{testCaseResultSummary}') != 0";

View File

@ -145,7 +145,7 @@ export const TestSuites = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
const result = await getListTestSuites({
...params,
fields: 'owner,summary',
includeEmptyTestSuites: false,
includeEmptyTestSuites: !(tab === DataQualityPageTabs.TABLES),
testSuiteType:
tab === DataQualityPageTabs.TABLES
? TestSuiteType.executable

View File

@ -139,7 +139,7 @@ describe('TestSuites component', () => {
).toBeInTheDocument();
expect(mockGetListTestSuites).toHaveBeenCalledWith({
fields: 'owner,summary',
includeEmptyTestSuites: false,
includeEmptyTestSuites: true,
limit: 15,
testSuiteType: 'logical',
});