mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-06-16 13:46:16 +02:00
Display actual error within the form.
This commit is contained in:
@ -39,9 +39,10 @@ describe("<WiFiSettings/>", () => {
|
||||
it("should handle error", async () => {
|
||||
const webSockets = new WebSockets();
|
||||
const { getByText } = render(<WiFiSettings ws={webSockets} ws={webSockets} endpoint={endpoint} resetEndpoint="foo" />);
|
||||
mockJSONError();
|
||||
const errorMessage = "An API error occurred.";
|
||||
mockJSONError(errorMessage);
|
||||
await wait(() => {
|
||||
expect(getByText("An error occurred while fetching data.")).toBeTruthy();
|
||||
expect(getByText(errorMessage)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user