-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(invalid_test): show error popup if test data is invalid (#516)
- Loading branch information
1 parent
60b1d7f
commit fa93612
Showing
4 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const EMPTY_STRING = ""; | ||
const ERROR_TITLE = "Error"; | ||
const INVALID_TEST_MESSAGE = "Oh no, I can't render this test, please use the API."; | ||
const OK_BUTTON_MESSAGE = "OK"; | ||
|
||
export { | ||
EMPTY_STRING, | ||
ERROR_TITLE, | ||
INVALID_TEST_MESSAGE, | ||
OK_BUTTON_MESSAGE, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createStateForEditTest } from '../features/components/TestForm/utils'; | ||
|
||
const isTestValid = (test) => { | ||
try { | ||
createStateForEditTest(test); | ||
return true; | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
export { | ||
isTestValid, | ||
} |