CopyCat test in React Test Library Final Project

I’m on the final project for Learn React Testing the CopyCat project from the unit test POV.
I’m stuck on step 3 of all things. I entered in the data given and I get a syntax error as soon as I put in either (or both) empty arrow functions. I’ve tried to redo it a couple of times and I get snagged here each time. I know it will be something small and stupid but I just can’t see what’s wrong.

Thank you!

import { CopyCat } from "../CopyCat"; // Make all the imports below import React from "react"; import { render, screen } from "@testing-library/react"; import "@testing-library/jest-dom"; test("Should display name", () => { // Write your solution to tasks 3-4 within this test render( <CopyCat name={"Mack"} value={""} isCopying={true} handleChange={()=>} toggleTape={()=>} /> ); }); test("Should display input text in paragraph when isCopying is set to true", () => { // Write your solution to tasks 5-6 within this test }); test("Should not display input text in paragraph when isCopying is set to false", () => { // Write your solution to task 7 within this test });

I think it’s just because they are empty. If you haven’t gotten past this already, just keep going until you fill those parts in and then see if it works afterwards.

Thank you for this-I got past it by adding console.log(name) to each-It worked and I’m not going to question why :rofl: Actually, someone at work explained it when I told them I was baffled why my half joking attempt to fix it worked.

1 Like

I know you’re past this already and it’s been a while, but I feel it’s helpful to know that the full content of a callback function is

() => {}

which means including the final object. That may be the piece it was looking for.