Skip to content

Commit

Permalink
Update dashboard title and app title
Browse files Browse the repository at this point in the history
  • Loading branch information
saracrz committed Nov 10, 2023
1 parent 08e4c90 commit 6976b9b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React app</title>
<title>Dashboards App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { App } from "./App";
test("App component display header", () => {
render(<App />);

const heading = screen.getByText("Dashboard");
const heading = screen.getByText("Dashboards");

expect(heading).toBeInTheDocument();
});
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DashboardPage } from "./pages/DashboardPage";
import { DashboardsPage } from "./pages/DashboardsPage";

export const App = () => {
return (
<div className="App">
<h4>Dashboard</h4>
<DashboardPage />
<h4>Dashboards</h4>
<DashboardsPage />
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
mockUseGetDashboards,
mockUseGetDashboardsLoadingData,
} from "../../tests/fixtures/useGetDashboards";
import { DashboardPage } from "./DashboardPage";
import { DashboardsPage } from "./DashboardsPage";

jest.mock("../hooks/useGetDashboards", () => ({
useGetDashboards: jest.fn(),
}));

test("Dashboard component displays dashboards titles", () => {
mockUseGetDashboards(mockedDashboards);
render(<DashboardPage />);
render(<DashboardsPage />);

expect(screen.getByText("Antenatal Care")).toBeInTheDocument();
expect(screen.getByText("Cases Malaria")).toBeInTheDocument();
Expand All @@ -24,7 +24,7 @@ test("Dashboard component displays dashboards titles", () => {

test("Dashboard component when loading data should display the Loading text", () => {
mockUseGetDashboardsLoadingData([]);
render(<DashboardPage />);
render(<DashboardsPage />);

expect(screen.queryByText("Antenatal Care")).not.toBeInTheDocument();
expect(screen.queryByText("Cases Malaria")).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CollapsibleCard } from "../containers/CollapsibleCard";
import { Divider } from "../containers/styles";
import { useGetDashboards } from "../hooks/useGetDashboards";

export const DashboardPage = () => {
export const DashboardsPage = () => {
const { dashboards, loading } = useGetDashboards();
const [openCardId, setOpenCardId] = useState<string | null>(null);

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("The Home Page", () => {
it("successfully loads", () => {
cy.visit("/");
cy.findByRole("heading", {
name: "Dashboard",
name: "Dashboards",
}).should("exist");
});
});

0 comments on commit 6976b9b

Please sign in to comment.