From d736c5826557311bbc060746586d59e99b619ced Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Wed, 15 May 2024 13:58:45 -0700 Subject: [PATCH] fix: config test --- src/config.ts | 3 ++- test/compile/data/filterinvalid.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index d339d387a1..4956261e2c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -602,9 +602,10 @@ export function initConfig(specifiedConfig: Config = {}): Config { if (mergedConfig.scale) { const {invalid, ...otherScaleConfig} = mergedConfig.scale; + const newScaleInvalid = replaceExprRef(invalid, {level: 1}); outputConfig.scale = { ...replaceExprRef(otherScaleConfig), - invalid: replaceExprRef(invalid, {level: 1}) + ...(keys(newScaleInvalid).length > 0 ? {invalid: newScaleInvalid} : {}) }; } diff --git a/test/compile/data/filterinvalid.test.ts b/test/compile/data/filterinvalid.test.ts index f23412ef04..fe1b272a7d 100644 --- a/test/compile/data/filterinvalid.test.ts +++ b/test/compile/data/filterinvalid.test.ts @@ -47,11 +47,11 @@ describe('compile/data/filterinvalid', () => { }); }); - it('should add no null filter if when invalid is null', () => { + it('should add no null filter if when invalid is show', () => { const model = parseUnitModelWithScale( mergeDeep>(spec, { config: { - mark: {invalid: null} + mark: {invalid: 'show'} } }) );