From 19993dc73d48d47079a75b252f465e1bc5b0e74a Mon Sep 17 00:00:00 2001 From: David Ortner Date: Wed, 5 Oct 2022 16:40:09 +0200 Subject: [PATCH] #344@trivial: Adds test for computed style with the properties display and direction. --- packages/happy-dom/test/window/Window.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/happy-dom/test/window/Window.test.ts b/packages/happy-dom/test/window/Window.test.ts index 9d2f70342..d2f026190 100644 --- a/packages/happy-dom/test/window/Window.test.ts +++ b/packages/happy-dom/test/window/Window.test.ts @@ -204,6 +204,16 @@ describe('Window', () => { }); describe('getComputedStyle()', () => { + it('Handles default properties "display" and "direction".', () => { + const element = document.createElement('div'); + const computedStyle = window.getComputedStyle(element); + + window.document.body.appendChild(element); + + expect(computedStyle.direction).toBe('ltr'); + expect(computedStyle.display).toBe('block'); + }); + it('Returns a CSSStyleDeclaration object with computed styles that are live updated whenever the element styles are changed.', () => { const element = document.createElement('div'); const computedStyle = window.getComputedStyle(element);