-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thais Martins
committed
Sep 6, 2023
1 parent
95f9988
commit afa254c
Showing
6 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const handlers = []; | ||
import { pokemonHandlers } from "./pokemon"; | ||
|
||
export const handlers = [...pokemonHandlers]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { render, screen, act, waitFor } from "@testing-library/react"; | ||
import user from "@testing-library/user-event"; | ||
import RootLayout from "@/app/layout"; | ||
import Page from "@/app/page"; | ||
|
||
describe("Index page", () => { | ||
it("render", () => { | ||
render( | ||
<RootLayout> | ||
<Page /> | ||
</RootLayout> | ||
); | ||
|
||
expect(screen.getByRole("combobox")).toBeInTheDocument(); | ||
}); | ||
|
||
it("displays Bulbasaur pokemon when selecting grass type", async () => { | ||
render(<Page />); | ||
|
||
user.click(screen.getByRole("combobox")); | ||
|
||
await waitFor(async () => { | ||
user.click(screen.getByRole("option", { name: /grama/i })); | ||
}); | ||
|
||
await waitFor(async () => { | ||
expect(screen.getByText(/pikachu/i)).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters