Skip to content

Rendered dom not being removed from document after each test when attachToDocument is true #1185

Closed
@tmorehouse

Description

@tmorehouse

Version

1.0.0-beta.29

Reproduction link

https://codesandbox.io/s/y006o3zxqz

Steps to reproduce

Run the sanbox, and view the test results.

The second test fails, as it finds two buttons in the DOM.

What is expected?

The previous test's DOM to be removed from the document.

What is actually happening?

the old test DOM persists in the document.


When using document.querySelectorAll(...) inside an app, and testing various scenarios, the old APPs DOM is not being removed from the JSDOM document when mountToDocument: true is set during mount, causing unexpected results in the tests.

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