diff --git a/web-console/src/components/json-input/json-input.tsx b/web-console/src/components/json-input/json-input.tsx index cf6b3ec07d32..3cbfd3807bae 100644 --- a/web-console/src/components/json-input/json-input.tsx +++ b/web-console/src/components/json-input/json-input.tsx @@ -24,7 +24,9 @@ import AceEditor from 'react-ace'; import './json-input.scss'; function parseHjson(str: string) { - return str === '' ? null : Hjson.parse(str); + // Throwing on empty input is more consistent with how JSON.parse works + if (str.trim() === '') throw new Error('empty hjson'); + return Hjson.parse(str); } function stringifyJson(item: any): string { diff --git a/web-console/src/dialogs/spec-dialog/__snapshots__/spec-dialog.spec.tsx.snap b/web-console/src/dialogs/spec-dialog/__snapshots__/spec-dialog.spec.tsx.snap index 72f8f2473633..9e17016cf5c6 100644 --- a/web-console/src/dialogs/spec-dialog/__snapshots__/spec-dialog.spec.tsx.snap +++ b/web-console/src/dialogs/spec-dialog/__snapshots__/spec-dialog.spec.tsx.snap @@ -1,6 +1,187 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`spec dialog matches snapshot 1`] = ` +exports[`spec dialog matches snapshot no initSpec 1`] = ` +