Skip to content

Commit

Permalink
Fixed Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianTan166 committed May 19, 2024
1 parent b9f2e01 commit a2a42a9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 36 deletions.
15 changes: 0 additions & 15 deletions src/components/atoms/Header/Header.test.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/atoms/Header/Header.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/organisms/ImagesList/HomeImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const HomeImageList = () => {
}

// Render only the first row of images
const firstRowImages = data.pokemon_entries.slice(0, 6); // Assuming each row contains 4 images
const firstRowImages = data.slice(0, 6); // Assuming each row contains 4 images

return (
<div className="wrap justify-evenly w-11/12 mt-4 ">
{firstRowImages.map((image) => {
return <ImageTile key={image.entry_number} image={image} />;
return <ImageTile key={image.name} image={image} />;
})}
</div>
);
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/Home/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const wrapWithMemoryRouter = (
describe("Home", () => {
it("should display the HTML content", async () => {
renderWithQueryClientProvider(wrapWithMemoryRouter);
screen.getByText(/Welcome to Home Page/);
screen.getByText(/This is a paragraph/);
screen.getByText(/Send us your/);
screen.getByText(/Satellite Streak/);
screen.getByText(/Learn more/);
screen.getByText(/View Gallery/);
// Add assertions for other elements if needed
});
});
6 changes: 4 additions & 2 deletions src/router/AppRouter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ describe("AppRouter", () => {
it("renders all components", async () => {
renderWithQueryClientProvider(<AppRouter />);

screen.getByText(/^SpaceTitle$/);
screen.getByText(/Placeholder Read Me/);
screen.getByText(/Send us your/);
screen.getByText(/Satellite Streak/);
screen.getByText(/Learn more/);
screen.getByText(/View Gallery/);
});
});
2 changes: 0 additions & 2 deletions src/router/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Gallery from "../components/pages/Gallery/Gallery";
import Header from "src/components/atoms/Header/Header";
import Health from "src/components/molecules/Health/Health";
import Home from "src/components/pages/Home/Home";
import ImageInfo from "src/components/pages/ImageInfo/ImageInfo";
Expand All @@ -11,7 +10,6 @@ import Upload from "../components/pages/Upload/Upload";
const AppRouter = () => {
return (
<BrowserRouter>
<Header />
<NavBar />
<main>
<Routes>
Expand Down

0 comments on commit a2a42a9

Please sign in to comment.