1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Format all files with Prettier

This commit is contained in:
Aleksandr Gumroian
2020-08-18 15:39:00 +02:00
parent e41da48b1a
commit f8726e6012
80 changed files with 933 additions and 804 deletions

View File

@ -22,19 +22,34 @@ describe("<ResetWiFiSettings/>", () => {
let getAllByText;
beforeEach(() => {
({ getAllByText } = render(<ResetWiFiSettings ws={webSockets} endpoint={endpoint} />));
({ getAllByText } = render(
<ResetWiFiSettings ws={webSockets} endpoint={endpoint} />
));
});
it("should display alert on open ports - success", async () => {
fireEvent.click(getAllByText("Reset Wi-Fi Settings")[1]);
expect(mockAxios.post).toBeCalledWith(endpoint, undefined, expect.anything());
expect(mockAxios.post).toBeCalledWith(
endpoint,
undefined,
expect.anything()
);
mockAxios.mockResponse({ data: { foo: "bar" } });
await wait(() => expect(mockSetAlert).toBeCalledWith("Wi-Fi settings are set to defaults.", ALERT_TYPES.SUCCESS));
await wait(() =>
expect(mockSetAlert).toBeCalledWith(
"Wi-Fi settings are set to defaults.",
ALERT_TYPES.SUCCESS
)
);
});
it("should display alert on open ports - failure", async () => {
fireEvent.click(getAllByText("Reset Wi-Fi Settings")[1]);
mockJSONError();
await wait(() => expect(mockSetAlert).toBeCalledWith("An error occurred during resetting Wi-Fi settings."));
await wait(() =>
expect(mockSetAlert).toBeCalledWith(
"An error occurred during resetting Wi-Fi settings."
)
);
});
});

View File

@ -292,11 +292,7 @@ export function wifiSettingsFixture() {
radar: false,
},
],
available_htmodes: [
"NOHT",
"HT20",
"HT40",
],
available_htmodes: ["NOHT", "HT20", "HT40"],
hwmode: "11g",
},
],
@ -327,9 +323,9 @@ const oneDevice = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: "TestPass"
}
]
password: "TestPass",
},
],
};
const twoDevices = {
@ -343,7 +339,7 @@ const twoDevices = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: "TestPass"
password: "TestPass",
},
{
SSID: "Turris2",
@ -354,9 +350,9 @@ const twoDevices = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: "TestPass"
}
]
password: "TestPass",
},
],
};
const threeDevices = {
@ -370,7 +366,7 @@ const threeDevices = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: "TestPass"
password: "TestPass",
},
{
SSID: "Turris2",
@ -381,7 +377,7 @@ const threeDevices = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: "TestPass"
password: "TestPass",
},
{
SSID: "Turris3",
@ -392,9 +388,9 @@ const threeDevices = {
htmode: "HT40",
hwmode: "11a",
id: 0,
password: ""
}
]
password: "",
},
],
};
export {oneDevice, twoDevices, threeDevices};
export { oneDevice, twoDevices, threeDevices };