TypeError: Cannot read properties of null during testing onSubmit

I’m trying to test whether text in a submit button changes, after the submit button is clicked on.
Once the submit button is clicked, it follows the typical upload image path and gives me errors related to the parent element.

Here is the test:

it("text change within button on load", async () => {
    const user = userEvent.setup();
    const mockFn = jest.fn();
    render(<CreateProfilePhoto handleAddData={mockFn} handleSubmit={mockFn} />);
    const file = new File(["hello"], "hello.png", { type: "image/png" });
    const input = screen.getByTestId("upload-prompt");
    await user.upload(input, file);
    const uploadImage = screen.getByRole("button", { name: /upload image/i });
    await user.click(uploadImage);
    expect(
      screen.getByRole("button", { name: /busy.../i })
    ).toBeInTheDocument();
  });

Here is the error:

   90 |     await user.upload(input, file);
      91 |     const uploadImage = screen.getByRole("button", { name: /upload image/i });
    > 92 |     await user.click(uploadImage);
         |     ^
      93 |     expect(
      94 |       screen.getByRole("button", { name: /busy.../i })
      95 |     ).toBeInTheDocument();

and

Profile Photo Create › text change within button on load

    TypeError: Cannot read properties of null (reading 'uid')

      57 |       const imageRef = ref(
      58 |         storage,
    > 59 |         "profileImage/" + user.uid + "/profilePhoto"
         |                                ^
      60 |       );
      61 |    
      62 |       uploadBytes(imageRef, image)

I tried to add handleSubmit through props but i know that its not passed through props so it won’t make a difference.
What’s causing this error? How do i keep it within the bounds of the unit test?