Skip to content

Commit

Permalink
Add modification to Loading.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
barbara28bgb committed Nov 3, 2023
1 parent 76b1364 commit 6f8de72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/components/Loading/Loading.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Loading from "./Loading";
import { ThemeProvider } from "styled-components";
import mainTheme from "../../styles/mainTheme";
import { BrowserRouter } from "react-router-dom";
import UiContextWrapped from "../../features/Ui/store/UiContextWrapper";

describe("Given a Loading component", () => {
describe("When is render", () => {
Expand All @@ -12,9 +13,11 @@ describe("Given a Loading component", () => {

render(
<BrowserRouter>
<ThemeProvider theme={mainTheme}>
<Loading />
</ThemeProvider>{" "}
<UiContextWrapped>
<ThemeProvider theme={mainTheme}>
<Loading />
</ThemeProvider>{" "}
</UiContextWrapped>
</BrowserRouter>,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PropsWithChildren, useState } from "react";
const UiContextWrapped = ({
children,
}: PropsWithChildren): React.ReactElement => {
const [isLoading, setIsLoading] = useState(false);
const [isLoading, setIsLoading] = useState<boolean>(false);

return (
<UiContext.Provider value={{ isLoading, setIsLoading }}>
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import mainTheme from "./styles/mainTheme";
import CharacarterWrapper from "./features/characters/store/CharactersWrapper";
import GlobalStyle from "./styles/GlobalStyle";
import "@fontsource-variable/changa";
import UiContextWrapped from "./features/Ui/store/UiContextWrapped";
import UiContextWrapped from "./features/Ui/store/UiContextWrapper";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
Expand Down

0 comments on commit 6f8de72

Please sign in to comment.