Make color scheme optional (#17357)
This commit is contained in:
parent
fa51b3234e
commit
ee7c34b5b3
|
|
@ -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', () => {
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue