Skip to content

Dialog not rendering to jsdom #2279

@lynndylanhurley

Description

@lynndylanhurley

I'm having trouble getting the Dialog component to render to jsdom.

My render code:

render () {
  return (
    <Dialog
      open={true}
      title="Test">
      Testing with jsdom
    </Dialog>
  )
}

I'm checking the resulting jsdom like this:

TestUtils.renderIntoDocument(
  <TestDialog />
)

// I've also tried setting a timeout here to account for the transition time, but
// I still get the same result.
console.log(document.documentElement.outerHTML);

The resulting html:

<html><head></head><body style="overflow: hidden;"><style>
      button::-moz-focus-inner,
      input::-moz-focus-inner {
        border: 0;
        padding: 0;
      }
    </style></body></html>

I've been able to test the react-bootstrap Modal component as well as the react-modal component in this way, so I don't think there's a problem with my test setup.

Any advice on how to render the Dialog component with jsdom?

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: dialogChanges related to the dialog.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions