2022-12-07 10:20:09 +00:00
|
|
|
import "@testing-library/jest-dom";
|
|
|
|
|
2022-12-02 11:58:43 +00:00
|
|
|
import { configure } from "@testing-library/react";
|
|
|
|
|
2022-10-27 15:26:09 +00:00
|
|
|
document.getElementById = () => document.createElement("div");
|
2022-11-16 15:01:34 +00:00
|
|
|
|
2023-01-24 13:59:14 +00:00
|
|
|
// workaround for `jsdom`
|
|
|
|
// https://github.com/jsdom/jsdom/issues/3002
|
|
|
|
document.createRange = () => {
|
|
|
|
const range = new Range();
|
|
|
|
|
|
|
|
range.getBoundingClientRect = jest.fn();
|
|
|
|
|
|
|
|
range.getClientRects = () => ({
|
|
|
|
item: () => null,
|
|
|
|
length: 0,
|
|
|
|
[Symbol.iterator]: jest.fn(),
|
|
|
|
});
|
|
|
|
|
|
|
|
return range;
|
|
|
|
};
|
|
|
|
|
2022-11-16 15:01:34 +00:00
|
|
|
window.__SALEOR_CONFIG__ = {
|
|
|
|
API_URL: "http://localhost:8000/graphql/",
|
|
|
|
APP_MOUNT_URI: "/",
|
2023-01-10 10:04:30 +00:00
|
|
|
MARKETPLACE_URL: "http://localhost:3000",
|
2022-11-30 16:20:20 +00:00
|
|
|
SALEOR_APPS_PAGE_PATH: "/saleor-apps",
|
|
|
|
SALEOR_APPS_JSON_PATH: "/api/saleor-apps",
|
|
|
|
APP_TEMPLATE_GALLERY_PATH: "/template-gallery",
|
2023-01-10 10:04:30 +00:00
|
|
|
APPS_MARKETPLACE_API_URI: "http://localhost:3000",
|
|
|
|
APPS_TUNNEL_URL_KEYWORDS: ".ngrok.io;.saleor.live",
|
2023-03-03 08:34:18 +00:00
|
|
|
IS_CLOUD_INSTANCE: "true",
|
2022-11-16 15:01:34 +00:00
|
|
|
};
|
2022-12-02 11:58:43 +00:00
|
|
|
|
2022-12-07 10:20:09 +00:00
|
|
|
process.env.TZ = "UTC";
|
|
|
|
|
2022-12-02 11:58:43 +00:00
|
|
|
configure({ testIdAttribute: "data-test-id" });
|