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:
@ -15,7 +15,7 @@ window.AlertContext = React.createContext();
|
||||
function AlertContextMock({ children }) {
|
||||
return (
|
||||
<AlertContext.Provider value={[mockSetAlert, mockDismissAlert]}>
|
||||
{ children }
|
||||
{ children }
|
||||
</AlertContext.Provider>
|
||||
);
|
||||
}
|
||||
|
@ -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" } } });
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user