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

Wi-Fi settings form

This commit is contained in:
Maciej Lenartowicz
2020-01-09 11:25:29 +01:00
parent 9dcc689491
commit 5fd0d3626a
33 changed files with 2913 additions and 97 deletions

View File

@ -15,7 +15,7 @@ window.AlertContext = React.createContext();
function AlertContextMock({ children }) {
return (
<AlertContext.Provider value={[mockSetAlert, mockDismissAlert]}>
{ children }
{ children }
</AlertContext.Provider>
);
}

View File

@ -5,7 +5,7 @@
* See /LICENSE for more information.
*/
import mockAxios from 'jest-mock-axios';
import mockAxios from "jest-mock-axios";
export function mockJSONError(data) {
mockAxios.mockError({ response: { data, headers: { "content-type": "application/json" } } });

View File

@ -5,8 +5,8 @@
* See /LICENSE for more information.
*/
import mockAxios from 'jest-mock-axios';
import moment from 'moment-timezone';
import mockAxios from "jest-mock-axios";
import moment from "moment-timezone";
// Setup axios cleanup
global.afterEach(() => {
@ -14,9 +14,9 @@ global.afterEach(() => {
});
// Mock babel (gettext)
global._ = str => str;
global.ngettext = str => str;
global.babel = {format: (str) => str};
global._ = (str) => str;
global.ngettext = (str) => str;
global.babel = { format: (str) => str };
global.ForisTranslations = {};
// Mock web sockets
@ -25,9 +25,9 @@ window.WebSocket = jest.fn();
// Mock scrollIntoView
global.HTMLElement.prototype.scrollIntoView = () => {};
jest.doMock('moment', () => {
moment.tz.setDefault('UTC');
// Mock timezone utilities
jest.doMock("moment", () => {
moment.tz.setDefault("UTC");
return moment;
});
Date.now = jest.fn(() => new Date(Date.UTC(2019, 1, 1, 12, 13, 14)).valueOf());