Skip to content

Commit

Permalink
Add container element to document.body
Browse files Browse the repository at this point in the history
Make the `mount` function actually add the container to the document body, as
described in the API docs.
  • Loading branch information
robertknight committed Nov 26, 2024
1 parent ce30201 commit ff6df8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export function mount(jsx: VNode, { connected = false }: MountOptions = {}) {
const container = document.createElement('div');
container.setAttribute('data-enzyme-container', '');
containers.push(container);

document.body.append(container);

wrapper = enzyme.mount(jsx, { attachTo: container });
} else {
wrapper = enzyme.mount(jsx);
Expand Down

0 comments on commit ff6df8a

Please sign in to comment.