Skip to content

Bug: "data-testid" plugin doesn't work when used to get a nested element #2661

Open
@amanda-santos

Description

@amanda-santos

Describe the bug

I have added a DataTestId plugin in my project following the docs example. However, when I try to get an element by the test ID and then I use that element and try to run the test ID query again to get an element within it it doesn't work. Is there a way to fix this or is it a limitation of the plugin? I'm almost certain that I was able to do that with the Testing Library.

To Reproduce
https://stackblitz.com/edit/vitejs-vite-qv7c8k7w?file=src%2Fcomponents%2FHelloWorld.spec.js

Expected behavior
I was hoping to be able to get the elements within another element using the plugin query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions