Attempt to fix the stable waterfall

Bug:none
Change-Id: I71de25a8e82dba34391ea61f5fe39218150b2162
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5965795
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/front_end/ui/legacy/theme_support/ThemeSupport.test.ts b/front_end/ui/legacy/theme_support/ThemeSupport.test.ts
index ce3a02c..9681abd 100644
--- a/front_end/ui/legacy/theme_support/ThemeSupport.test.ts
+++ b/front_end/ui/legacy/theme_support/ThemeSupport.test.ts
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 import * as Host from '../../../core/host/host.js';
+import {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';
 import {createFakeSetting, describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';
 
 import * as ThemeSupport from './theme_support.js';
@@ -61,17 +62,13 @@
       customElements.define('test-styled-component', StyledComponent);
     });
 
-    afterEach(() => {
-      document.body.removeChildren();
-    });
-
     it('obtains computed values correctly (document)', () => {
       assert.isNotEmpty(themeSupport.getComputedValue('--color-primary-old'));
     });
 
     it('obtains computed values correctly (element)', () => {
       const element = new StyledComponent();
-      document.body.appendChild(element);
+      renderElementIntoDOM(element);
 
       const documentValue = themeSupport.getComputedValue('--color-primary-old');
       const elementValue = themeSupport.getComputedValue('--color-primary-old', element);
@@ -96,7 +93,7 @@
 
     it('caches computed values (element)', () => {
       const element = new StyledComponent();
-      document.body.appendChild(element);
+      renderElementIntoDOM(element);
 
       const elementValue = themeSupport.getComputedValue('--color-primary-old', element);
       assert.isNotEmpty(elementValue);