fix(dashboard): multiple lines and indentation when editing json (#11501)

* multiple lines and indentation when editing json

* fix tests, address pr feedback

* remove json minification
This commit is contained in:
David Aaron Suddjian
2020-11-02 13:39:04 -08:00
committed by GitHub
parent a874b14a8a
commit d7aa3d792b
4 changed files with 15 additions and 5 deletions

View File

@@ -87,14 +87,14 @@ describe('PropertiesModal', () => {
const modalInstance = wrapper.find('PropertiesModal').instance();
modalInstance.setState({
values: {
json_metadata: '{"color_scheme":"foo"}',
json_metadata: '{"color_scheme": "foo"}',
},
});
it('will update the metadata', () => {
const spy = jest.spyOn(modalInstance, 'onMetadataChange');
modalInstance.onColorSchemeChange('SUPERSET_DEFAULT');
expect(spy).toHaveBeenCalledWith(
'{"color_scheme":"SUPERSET_DEFAULT"}',
'{"color_scheme": "SUPERSET_DEFAULT"}',
);
});
});
@@ -176,7 +176,7 @@ describe('PropertiesModal', () => {
expect(modalInstance.state.values.dashboard_title).toEqual('New Title');
expect(modalInstance.state.values.slug).toEqual('/new');
expect(modalInstance.state.values.json_metadata).toEqual(
'{"something":"foo"}',
'{"something": "foo"}',
);
});