Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvanes committed Sep 20, 2024
1 parent bf1fa86 commit f03536d
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export const ClimateSensorsCard: FC = () => {
</List>
);
};

export default ClimateSensorsCard;
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,5 @@ export const SpeedTestCard: FC = () => {
</Card>
);
};

export default SpeedTestCard;
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export const SwitchesCard: FC = () => {
</List>
);
};

export default SwitchesCard;
12 changes: 12 additions & 0 deletions apps/client/src/Components/Pages/Dashboard/Dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
6 changes: 3 additions & 3 deletions apps/client/src/Components/Pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ exports[`Dashboard page contains all the control components 1`] = `
<div
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-md-3 css-iv7vbz-MuiGrid-root"
>
<div
class="switch-bar-list-wrapper"
>
<mock-switch-bar-list />
</div>
<mock-switches-card />
<mock-climatesensor-card />
<mock-gaschart />
<mock-homesec />
<mock-url-to-music />
Expand Down Expand Up @@ -89,6 +86,7 @@ exports[`Dashboard page contains all the control components 1`] = `
style="margin-bottom: 20px;"
/>
<mock-dockerstacklist-card />
<mock-speedtest-card />
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorPrimary MuiIconButton-sizeMedium css-1kuq5xv-MuiButtonBase-root-MuiIconButton-root"
tabindex="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { render } from "@testing-library/react";
import HomeAutomation from "./HomeAutomation";

jest.mock(
"../../Molecules/SwitchBarList/SwitchBarList",
() => "mock-switch-bar-list"
"../../Molecules/ClimateSensorsCard/ClimateSensorsCard",
() => "mock-climatesensors-list"
);
jest.mock(
"../../Molecules/SwitchesCard/SwitchesCard",
() => "mock-switches-list"
);
jest.mock("../../Molecules/GasChart/GasChart", () => "mock-gaschart");

describe("HomeAutomation page", () => {
it("contains the SwitchBarList", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Stack } from "@mui/material";
import { FC } from "react";
import { ClimateSensorsCard } from "../../Molecules/ClimateSensorsCard/ClimateSensorsCard";
import { SwitchesCard } from "../../Molecules/SwitchesCard/SwitchesCard";
import ClimateSensorsCard from "../../Molecules/ClimateSensorsCard/ClimateSensorsCard";
import SwitchesCard from "../../Molecules/SwitchesCard/SwitchesCard";

const HomeAutomation: FC = () => (
<Stack gap={1}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
exports[`HomeAutomation page contains the SwitchBarList 1`] = `
<body>
<div>
<mock-switch-bar-list />
<mock-gaschart
isbig="true"
/>
<div
class="css-hwnj0i-MuiStack-root"
>
<mock-switches-list />
<mock-climatesensors-list />
</div>
</div>
</body>
`;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homeremote",
"version": "3.6.10",
"version": "3.7.0",
"license": "MIT",
"scripts": {
"writeGitInfo": "ts-node --project ./tsconfig.node.json writeGitInfo.ts",
Expand Down

0 comments on commit f03536d

Please sign in to comment.