From 361909c3718c35d190d4249918cc0bf7db6e93dc Mon Sep 17 00:00:00 2001 From: Viktor Ohad Date: Mon, 14 Jun 2021 19:46:22 +0200 Subject: [PATCH] fix(ui-test-sandbox): fix issue with `emotion` can't insert node inside `head` stop observing changes being made in the `head` section of the document, because the teardown of the sandbox was deleting nodes from it and it messed up the `emotion` styling. --- packages/ui-test-sandbox/src/utils/sandbox.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/ui-test-sandbox/src/utils/sandbox.ts b/packages/ui-test-sandbox/src/utils/sandbox.ts index 5b2352a61f..2335c8db52 100644 --- a/packages/ui-test-sandbox/src/utils/sandbox.ts +++ b/packages/ui-test-sandbox/src/utils/sandbox.ts @@ -27,11 +27,6 @@ import { ReactComponentWrapper } from './reactComponentWrapper' import initConsole from './initConsole' import React from 'react' -// Likely this could be done with /// { if (node && typeof (node as ChildNode).remove === 'function') { - // TODO this code is buggy. It was originally doing nothing, but when - // its executed properly it causes an exception - //(node as ChildNode).remove() + ;(node as ChildNode).remove() } }) this._addedNodes = []