Skip to content

HTML title property of the main heading is hardcoded as "Header" #17

@chaitanyathengdi

Description

@chaitanyathengdi

Wrote a test for your app like this:

  it("shows HTML title that's passed from parent component", () => {
    render(<Header title="test-title" />);
    const header = screen.getByRole("heading");
    expect(header.title).toBe("test-title");
  })

returns the output:

  ● Header › shows HTML title that's passed from parent component

    expect(received).toBe(expected) // Object.is equality

    Expected: "test-title"
    Received: "Header"

      25 |     render(<Header title="test-title" />);
      26 |     const header = screen.getByRole("heading");
    > 27 |     expect(header.title).toBe("test-title");
         |                          ^
      28 |   })
      29 | })
      30 |

And this shows in the app: when you hover over either the Todo or the Followers heading, you get the title as Header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions