From 27c3a345364bcec90703a4ebe8d82d3cdef03cc7 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Wed, 8 Jun 2022 15:34:11 +0800 Subject: [PATCH] chore: superset-ui/core code coverage --- .../test/query/buildQueryContext.test.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/superset-frontend/packages/superset-ui-core/test/query/buildQueryContext.test.ts b/superset-frontend/packages/superset-ui-core/test/query/buildQueryContext.test.ts index be94a877b2923..366feeff7a2e1 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/buildQueryContext.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/buildQueryContext.test.ts @@ -108,4 +108,29 @@ describe('buildQueryContext', () => { ]), ); }); + it('should remove undefined value in post_processing', () => { + const queryContext = buildQueryContext( + { + datasource: '5__table', + viz_type: 'table', + }, + () => [ + { + post_processing: [ + undefined, + undefined, + { + operation: 'flatten', + }, + undefined, + ], + }, + ], + ); + expect(queryContext.queries[0].post_processing).toEqual([ + { + operation: 'flatten', + }, + ]); + }); });