I just ran into an issue where the Mock Server UI became unusable. Took me a few minutes to figure out what was going wrong. While the UI was open, a git operation had altered the filesystem and removed an endpoint.
Acceptance criterion
Given the Mock Server UI is loaded with a URL fragment
And that URL fragment no longer corresponds to an endpoint on the file system
When the UI loads
Then I do not expect the gray 'modal' overlay to appear, without any content being loaded, effectively blocking the UI.
Steps to reproduce:
Define an endpoint (GET /hello, for example).
Open the dialog to modify that endpoint (note the URL now contains a fragment identifier for that endpoint)
While the dialog is still open, delete the /hello endpoint from the filesystem.
Refresh the page.
The endpoint listing will be visible; however, the modal overlay blocks all UI interactions. No actual modal dialog is present, though.
Suggested fix
If the UI cannot load the data for the endpoint specified in the fragment, display an error instead of the edit dialog. Alternatively (possibly simpler), if the data cannot be loaded, do not try to show the edit dialog.
I just ran into an issue where the Mock Server UI became unusable. Took me a few minutes to figure out what was going wrong. While the UI was open, a git operation had altered the filesystem and removed an endpoint.
Acceptance criterion Given the Mock Server UI is loaded with a URL fragment And that URL fragment no longer corresponds to an endpoint on the file system When the UI loads Then I do not expect the gray 'modal' overlay to appear, without any content being loaded, effectively blocking the UI.
Steps to reproduce:
The endpoint listing will be visible; however, the modal overlay blocks all UI interactions. No actual modal dialog is present, though.
Suggested fix If the UI cannot load the data for the endpoint specified in the fragment, display an error instead of the edit dialog. Alternatively (possibly simpler), if the data cannot be loaded, do not try to show the edit dialog.