Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shammy642 committed Oct 23, 2024
1 parent 068b411 commit 2c312e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/H1.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const H1 = ({ children }) => {
return (
<h1 data-testid="game-name" className="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">
{ children }
</h1>
)
<h1 data-testid="game-name" className="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">
{ children }
</h1>
);
}
6 changes: 0 additions & 6 deletions frontend/src/pages/LandingHost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ export function LandingHost() {
const [error, setError] = useState("");


//user cna type in the form
const handleInputChange = (e) => {
const value = e.target.value;
setInput(value);
};

//click should redirect the user to the lobby
const handleClick = (e) => {
e.preventDefault();
Expand Down
10 changes: 1 addition & 9 deletions frontend/src/pages/LandingPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CardText } from "../components/CardText"
import { Card } from "../components/Card"
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import { H1 } from "../components/H1"


// landing page when a user clicks on a link generated by the host to join a game
Expand All @@ -19,16 +20,8 @@ export function LandingPlayer() {
const params = useParams()
const navigate = useNavigate()


//user cna type in the form
const handleInputChange = (e) => {
const value = e.target.value;
setInput(value);
}

//click should redirect the user to the lobby
const handleClick = (e) => {

e.preventDefault();

// Validate if the input is not empty
Expand Down Expand Up @@ -69,7 +62,6 @@ export function LandingPlayer() {
input={input}
error={error}
setInput={setInput}
handleInputChange={handleInputChange}
avatar={avatar}
setAvatar={setAvatar}
></UsernameForm>
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/pages/InGame.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("InGame tests", () => {
render(
<InGame players={players} pokemon={mockPokemon} redirect={""} setRedirect={setRedirect} />
);
const heading = screen.getByTestId("guess-label");
const heading = screen.getByTestId("game-name");
expect(heading.textContent).toEqual("Poké Poké Guess Weight!");
});
test("given a list of players, they are visible", () => {
Expand Down

0 comments on commit 2c312e5

Please sign in to comment.