Skip to content

Commit 2945982

Browse files
committed
Refactor unit test
1 parent e225bf5 commit 2945982

File tree

1 file changed

+1
-6
lines changed
  • packages/components/src/color-palette/test

1 file changed

+1
-6
lines changed

packages/components/src/color-palette/test/utils.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ describe( 'ColorPalette: Utils', () => {
4949
} );
5050
test( 'should return the background color computed from a element if the color value is a CSS variable', () => {
5151
const element = document.createElement( 'div' );
52-
const { ownerDocument } = element;
53-
const { defaultView } = ownerDocument;
54-
// @ts-ignore
55-
defaultView.getComputedStyle = () => ( {
56-
backgroundColor: '#ff0000',
57-
} );
52+
element.style.backgroundColor = '#ff0000';
5853
expect( normalizeColorValue( 'var(--red)', element ) ).toBe(
5954
'#ff0000'
6055
);

0 commit comments

Comments
 (0)