Skip to content

Vitest UI: file filter display inconsistent with re-run test cases #4735

@hi-ogawa

Description

@hi-ogawa

Describe the bug

File filter display seems inconsistent with what's re-run when filtering and also with the count in the label.

Here is a reproduction https://stackblitz.com/edit/vitest-dev-vitest-m3inyx
(no change from the original template https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/react-testing-lib)

  • Search by "count"
  • File list shows only useCounter.test.ts but with a label "Pass (2)"
  • Press "Rerun filtered" and see useCounter.test.ts and App.test.ts are executed in the terminal

Note that App.test.ts includes test case named should increment count on click and I assumed matching the test suite/case names is an intended behavior since that's the feature introduced in #1035.

Reveal screenshot

image


I think the issue is due to TaskTree is hiding TaskItem by unnecessary condition when used from TasksList while TasksList already applies filter to hide TaskTree:

<TaskItem
v-if="!search || caseInsensitiveMatch(task.name, search)"

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-m3inyx

System Info

(stackblitz)

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions