Skip to content

Update several TreeView unit tests #9825

@thatblindgeye

Description

@thatblindgeye

Describe the enhancement or change
Followup to #9773, some tests could use some updating

  • Update tests that are using getByText(...).tagName.toBe("BUTTON") so that they use getByRole("button") instead
  • In TreeViewRoot, add tests for hasCheckboxes and hasSelectableNodes; should first try testing if pressing Tab focuses the correct element, otherwise try using a user.click event, otherwise just check that the tabindex attribute is applied to the correct element
  • In TreeViewList, update the "Renders toolbar content when toolbar prop is passed" test to check that getByrole('separator') is in the doc, and update "Does not render toolbar content when toolbar prop is not passed" test to check that queryByText... is not in the doc
  • check that any getByRole('button') calls are also passing in the {name: ...} options object

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?

Any other information?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions