Skip to content

Commit d3b2af1

Browse files
committed
Include unit test for LoadingPage
1 parent 0067692 commit d3b2af1

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

frontend/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Navbar from "./shared/components/Navbar/Navbar";
44
import Chat from "./Chat";
55
import LoadingPage from "./pages/LoadingPage";
66

7+
// Lazy-loading for less frequented pages
78
const About = lazy(() => import("./About"));
89
const Disclaimer = lazy(() => import("./Disclaimer"));
910
const PrivacyPolicy = lazy(() => import("./PrivacyPolicy"));

frontend/src/pages/LoadingPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default function LoadingPage() {
22
return (
33
<div className="flex items-center justify-center h-screen">
44
<div className="text-center bg-paper-background/60 rounded-lg p-10">
5-
<div className="animate-spin rounded-full h-12 w-12 border-b-3 border-blue-dark mx-auto mb-4" />
5+
<div className="animate-spin rounded-full h-12 w-12 border-b-4 border-blue-dark mx-auto mb-4" />
66
<p className="text-xl">Loading...</p>
77
</div>
88
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { render, screen } from "@testing-library/react";
2+
import LoadingPage from "../../pages/LoadingPage";
3+
4+
describe("LoadingPage", () => {
5+
it("renders loading spinner and text", () => {
6+
render(<LoadingPage />);
7+
expect(screen.getByText("Loading...")).toBeInTheDocument();
8+
});
9+
});

0 commit comments

Comments
 (0)