From f03536d4dbec9ae5b13b004fd264f797cc7bdb9e Mon Sep 17 00:00:00 2001 From: mdvanes <4253562+mdvanes@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:34:57 +0200 Subject: [PATCH] fix tests --- .../ClimateSensorsCard/ClimateSensorsCard.tsx | 2 ++ .../Molecules/SpeedTestCard/SpeedTestCard.tsx | 2 ++ .../Molecules/SwitchesCard/SwitchesCard.tsx | 2 ++ .../Components/Pages/Dashboard/Dashboard.test.tsx | 12 ++++++++++++ .../src/Components/Pages/Dashboard/Dashboard.tsx | 6 +++--- .../Dashboard/__snapshots__/Dashboard.test.tsx.snap | 8 +++----- .../Pages/HomeAutomation/HomeAutomation.test.tsx | 9 ++++++--- .../Pages/HomeAutomation/HomeAutomation.tsx | 4 ++-- .../__snapshots__/HomeAutomation.test.tsx.snap | 10 ++++++---- package.json | 2 +- 10 files changed, 39 insertions(+), 18 deletions(-) diff --git a/apps/client/src/Components/Molecules/ClimateSensorsCard/ClimateSensorsCard.tsx b/apps/client/src/Components/Molecules/ClimateSensorsCard/ClimateSensorsCard.tsx index b333035e..755b34d3 100644 --- a/apps/client/src/Components/Molecules/ClimateSensorsCard/ClimateSensorsCard.tsx +++ b/apps/client/src/Components/Molecules/ClimateSensorsCard/ClimateSensorsCard.tsx @@ -47,3 +47,5 @@ export const ClimateSensorsCard: FC = () => { ); }; + +export default ClimateSensorsCard; diff --git a/apps/client/src/Components/Molecules/SpeedTestCard/SpeedTestCard.tsx b/apps/client/src/Components/Molecules/SpeedTestCard/SpeedTestCard.tsx index fe01188a..cadd6643 100644 --- a/apps/client/src/Components/Molecules/SpeedTestCard/SpeedTestCard.tsx +++ b/apps/client/src/Components/Molecules/SpeedTestCard/SpeedTestCard.tsx @@ -120,3 +120,5 @@ export const SpeedTestCard: FC = () => { ); }; + +export default SpeedTestCard; diff --git a/apps/client/src/Components/Molecules/SwitchesCard/SwitchesCard.tsx b/apps/client/src/Components/Molecules/SwitchesCard/SwitchesCard.tsx index 51a4aba4..f83f7361 100644 --- a/apps/client/src/Components/Molecules/SwitchesCard/SwitchesCard.tsx +++ b/apps/client/src/Components/Molecules/SwitchesCard/SwitchesCard.tsx @@ -47,3 +47,5 @@ export const SwitchesCard: FC = () => { ); }; + +export default SwitchesCard; diff --git a/apps/client/src/Components/Pages/Dashboard/Dashboard.test.tsx b/apps/client/src/Components/Pages/Dashboard/Dashboard.test.tsx index 4ba4d7b3..a16c29b4 100644 --- a/apps/client/src/Components/Pages/Dashboard/Dashboard.test.tsx +++ b/apps/client/src/Components/Pages/Dashboard/Dashboard.test.tsx @@ -34,6 +34,18 @@ jest.mock( "../../Molecules/DockerStackList/DockerStackListCard", () => "mock-dockerstacklist-card" ); +jest.mock( + "../../Molecules/SwitchesCard/SwitchesCard", + () => "mock-switches-card" +); +jest.mock( + "../../Molecules/ClimateSensorsCard/ClimateSensorsCard", + () => "mock-climatesensor-card" +); +jest.mock( + "../../Molecules/SpeedTestCard/SpeedTestCard", + () => "mock-speedtest-card" +); describe("Dashboard page", () => { it("contains all the control components", () => { diff --git a/apps/client/src/Components/Pages/Dashboard/Dashboard.tsx b/apps/client/src/Components/Pages/Dashboard/Dashboard.tsx index 714a0ce5..45bd87fe 100644 --- a/apps/client/src/Components/Pages/Dashboard/Dashboard.tsx +++ b/apps/client/src/Components/Pages/Dashboard/Dashboard.tsx @@ -3,7 +3,7 @@ import { Grid, IconButton } from "@mui/material"; import { FC, useState } from "react"; import { makeStyles } from "tss-react/mui"; import { CarTabs } from "../../Molecules/CarTabs/CarTabs"; -import { ClimateSensorsCard } from "../../Molecules/ClimateSensorsCard/ClimateSensorsCard"; +import ClimateSensorsCard from "../../Molecules/ClimateSensorsCard/ClimateSensorsCard"; import DockerStackListCard from "../../Molecules/DockerStackList/DockerStackListCard"; import DownloadList from "../../Molecules/DownloadList/DownloadList"; import GasChart from "../../Molecules/GasChart/GasChart"; @@ -14,9 +14,9 @@ import Monit from "../../Molecules/Monit/Monit"; import Nextup from "../../Molecules/Nextup/Nextup"; import Schedule from "../../Molecules/Schedule/Schedule"; import ServiceLinksBar from "../../Molecules/ServiceLinksBar/ServiceLinksBar"; -import { SpeedTestCard } from "../../Molecules/SpeedTestCard/SpeedTestCard"; +import SpeedTestCard from "../../Molecules/SpeedTestCard/SpeedTestCard"; import StreamContainer from "../../Molecules/StreamContainer/StreamContainer"; -import { SwitchesCard } from "../../Molecules/SwitchesCard/SwitchesCard"; +import SwitchesCard from "../../Molecules/SwitchesCard/SwitchesCard"; import UrlToMusic from "../../Molecules/UrlToMusic/UrlToMusic"; import VideoStream from "../../Molecules/VideoStream/VideoStream"; import Docker from "../Docker/Docker"; diff --git a/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap b/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap index d2089eed..2286cd69 100644 --- a/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap +++ b/apps/client/src/Components/Pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap @@ -9,11 +9,8 @@ exports[`Dashboard page contains all the control components 1`] = `