diff --git a/superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx b/superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx index efd33802f057b..e22bce70e76fd 100644 --- a/superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx +++ b/superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx @@ -148,6 +148,15 @@ describe('PropertiesModal', () => { expect(spy).toHaveBeenCalled(); }); }); + describe('with an empty color scheme as an arg', () => { + const wrapper = setup(); + const modalInstance = wrapper.find('PropertiesModal').instance(); + it('will not raise an error', () => { + const spy = jest.spyOn(Modal, 'error'); + modalInstance.onColorSchemeChange(''); + expect(spy).not.toHaveBeenCalled(); + }); + }); }); describe('onOwnersChange', () => { it('should update the state with the value passed', () => { diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx b/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx index aa9bef7efd50b..9597ccfccd3c6 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/index.jsx @@ -147,7 +147,8 @@ class PropertiesModal extends React.PureComponent { ? JSON.parse(jsonMetadata) : {}; - if (!colorScheme || !colorChoices.includes(colorScheme)) { + // only fire if the color_scheme is present and invalid + if (colorScheme && !colorChoices.includes(colorScheme)) { Modal.error({ title: 'Error', content: t('A valid color scheme is required'),