Skip to content

TreeView: Fix failing TreeView tests #7815

@TylerJDev

Description

@TylerJDev

Summary

We have a handful of tests in TreeView.test.tsx that are failing. This is likely caused by the usage of userEvent through Vitest. We temporarily skipped the failing tests, but we should investigate why they were failing to begin with.

Additional context

Only tests that utilize userEvent fail. This isn't exclusive to userEvent, as we use it in other tests, such as AnchoredOverlay.

Here's a comparison of usage between components that use userEvent through Vitest:

Pattern TreeView AnchoredOverlay Tabs TopicTag
Wraps userEvent in act() Yes Yes Yes No
Uses userEvent.setup() Yes No (direct calls) Yes No (direct calls)
Uses fireEvent alongside Yes (extensively) No Minimally No
Fake timers Yes No No No
renderWithTheme wrapper Yes (no-op) No No No
Mocks (scrollIntoView) Yes No No No

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: TreeViewIssues related to the TreeView componentstaffAuthor is a staff member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions