Skip to content

Commit

Permalink
test: Update snapshot and remove heading test
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroreign committed May 26, 2024
1 parent bf955d0 commit 1125a85
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 60 deletions.
32 changes: 18 additions & 14 deletions frontend/src/app/__snapshots__/page.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

exports[`App renders homepage unchanged 1`] = `
<div>
<div>
<h1>
Pokedex
</h1>
<p>
Welcome to the Pokedex App
</p>
<div
class="bg-white h-screen flex md:flex md:flex-auto md:items-center md:justify-center"
>
<div
class="bg-white relative py-8 px-6 border-double border-black rounded-bl-[2rem] rounded-t-[0.25rem] rounded-br[0.25rem] aspect-[4/3] size-1/6"
id="framed-screen"
class="flex flex-auto flex-col items-center justify-center bg-red md:max-w-sm md:min-h-[700px] md:rounded-md static inner-shadow-border"
>
<div
class="bg-black flex grow items-center justify-center relative text-white text-wrap rounded-[0.25rem] h-full w-full"
/>
class="bg-white relative shadow shadow-[#000000] pt-8 pl-9 pr-7 pb-11 m-2 border-double border-r-4 border-b-4 border-t-[1px] border-l border-[#000000] rounded-bl-[2.5rem] rounded-t-md rounded-br-md aspect-[4/3] w-10/12"
id="framed-screen"
>
<div
class="bg-black flex items-center justify-center relative text-white text-wrap rounded-[0.25rem] h-full w-full shadow-border"
/>
</div>
<div
class="relative w-10/12 m-8"
>
<div
class="bg-brown text-white font-mono tracking-wider h-[84px] w-full p-1.5 rounded-[0.25rem] shadow-border"
/>
</div>
</div>
<div
class="bg-brown text-white font-mono tracking-wider w-1/6 h-[72.974px]"
/>
</div>
</div>
`;
9 changes: 0 additions & 9 deletions frontend/src/app/page.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { PokemonTypes } from "@/components/PokemonAPIProvider/pokemon-api.types"
import PokemonAPIProvider from "@/components/PokemonAPIProvider";

describe("App", () => {
it("renders a heading", () => {
render(<Home />, { wrapper: PokemonAPIProvider });

const heading = screen.getByRole("heading", { level: 1 });

expect(heading).toBeInTheDocument();
expect(heading).toHaveTextContent("Pokedex");
});

it("renders homepage unchanged", () => {
const { container } = render(<Home />, { wrapper: PokemonAPIProvider });
expect(container).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FramedScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const FramedScreen = ({
return (
<div
id="framed-screen"
className={`bg-white relative shadow shadow-[#000000] py-8 px-6 m-2 border-double border-r-4 border-b-4 border-t-[1px] border-l border-[#000000] rounded-bl-[2.5rem] rounded-t-md rounded-br-md aspect-[4/3] w-10/12`}
className={`bg-white relative shadow shadow-[#000000] pt-8 pl-9 pr-7 pb-11 m-2 border-double border-r-4 border-b-4 border-t-[1px] border-l border-[#000000] rounded-bl-[2.5rem] rounded-t-md rounded-br-md aspect-[4/3] w-10/12`}
>
<div className="bg-black flex items-center justify-center relative text-white text-wrap rounded-[0.25rem] h-full w-full shadow-border">
{pokemon?.image && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,63 @@
exports[`Pokemon Details should be blank when there are no details 1`] = `
<div>
<div
class="bg-brown text-white font-mono tracking-wider w-1/6 h-[72.974px]"
/>
class="relative w-10/12 m-8"
>
<div
class="bg-brown text-white font-mono tracking-wider h-[84px] w-full p-1.5 rounded-[0.25rem] shadow-border"
/>
</div>
</div>
`;

exports[`Pokemon Details should render unchanged 1`] = `
<div>
<div
class="bg-brown text-white font-mono tracking-wider w-1/6 h-[72.974px]"
class="relative w-10/12 m-8"
>
<div
class="flex justify-between"
id="identifiers"
class="bg-brown text-white font-mono tracking-wider h-[84px] w-full p-1.5 rounded-[0.25rem] shadow-border"
>
<h2>
#
94
</h2>
<h2>
Gengar
</h2>
</div>
<ul
class="flex justify-evenly"
id="types"
>
<li>
<div
class="flex justify-between"
id="identifiers"
>
<h2>
#
94
</h2>
<h2>
Gengar
</h2>
</div>
<ul
class="flex justify-evenly"
id="types"
>
<li>
<p>
Poison
</p>
</li>
<li>
<p>
Ghost
</p>
</li>
</ul>
<div
class="flex justify-evenly space-x-8"
id="dimentions"
>
<p>
Poison
Height:
15
</p>
</li>
<li>
<p>
Ghost
Weight:
405
</p>
</li>
</ul>
<div
class="flex justify-evenly space-x-8"
id="dimentions"
>
<p>
Height:
15
</p>
<p>
Weight:
405
</p>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 1125a85

Please sign in to comment.