Skip to content

Commit

Permalink
#344@trivial: Adds test for computed style with the properties displa…
Browse files Browse the repository at this point in the history
…y and direction.
  • Loading branch information
capricorn86 committed Oct 5, 2022
1 parent 6b6ce08 commit 19993dc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/happy-dom/test/window/Window.test.ts
Expand Up @@ -204,6 +204,16 @@ describe('Window', () => {
});

describe('getComputedStyle()', () => {
it('Handles default properties "display" and "direction".', () => {
const element = <IHTMLElement>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 = <IHTMLElement>document.createElement('div');
const computedStyle = window.getComputedStyle(element);
Expand Down

0 comments on commit 19993dc

Please sign in to comment.