Skip to content

window.getComputedStyle second argument #725

@linonetwo

Description

@linonetwo

Is your feature request related to a problem? Please describe.

stderr | src/pages/Main/__tests__/index.test.tsx > Main Page > should switch to Agent page content when clicking Agent workspace       
Error: Not implemented: window.getComputedStyle(elt, pseudoElt)
    at module.exports (C:\Users\linonetwo\Documents\repo-c\TidGi-Desktop\node_modules\jsdom\lib\jsdom\browser\not-implemented.js:9:17) 
    at window.getComputedStyle (C:\Users\linonetwo\Documents\repo-c\TidGi-Desktop\node_modules\jsdom\lib\jsdom\browser\Window.js:895:7)
    at SimpleBarCore.getScrollbarWidth (C:\Users\linonetwo\Documents\repo-c\TidGi-Desktop\node_modules\simplebar-core\src\index.ts:266:11)
    at SimpleBarCore.init (C:\Users\linonetwo\Documents\repo-c\TidGi-Desktop\node_modules\simplebar-core\src\index.ts:301:34)

Describe the solution you'd like

Maybe follow the best practice, to not use second argument?

Describe alternatives you've considered

As an alternative I've only stripped the second (unsupported) parameter and this at least keeps that test functional:

const { getComputedStyle } = window;
window.getComputedStyle = (elt) => getComputedStyle(elt);

per NickColley/jest-axe#147 (comment)

Additional context

jsdom/jsdom#3025

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions