Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Feature/mat 7667 #756

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
"single-spa-react/parcel": "single-spa-react/lib/cjs/parcel.cjs",
"\\.(css|scss)$": "identity-obj-proxy",
},
setupFilesAfterEnv: ["@testing-library/jest-dom"],
setupFilesAfterEnv: ["@testing-library/jest-dom", "<rootDir>/jest.setup.js"],
globals: {
"ts-jest": {
tsconfig: {
Expand Down
1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.Request = jest.fn();
13 changes: 5 additions & 8 deletions src/components/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Suspense, useEffect, useState } from "react";
import { BrowserRouter } from "react-router-dom";
import RoutesWrapper from "./routes/RoutesWrapper";
import { ServiceConfig, ApiContextProvider } from "../api/ServiceContext";
import axios from "../api/axios-instance";
Expand Down Expand Up @@ -32,13 +31,11 @@ export default function Home() {
const loadingState = <div>Loading...</div>;

const loadedState = (
<BrowserRouter>
<ApiContextProvider value={serviceConfig}>
<Suspense fallback={<div>loading</div>}>
<RoutesWrapper />
</Suspense>
</ApiContextProvider>
</BrowserRouter>
<ApiContextProvider value={serviceConfig}>
<Suspense fallback={<div>loading</div>}>
<RoutesWrapper />
</Suspense>
</ApiContextProvider>
);

let result = serviceConfig === null ? loadingState : loadedState;
Expand Down
Loading
Loading