#725·simplebar

window.getComputedStyle second argument

Author: linonetwoCreated Jun 15, 2025Updated Jun 15, 2025

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 https://github.com/NickColley/jest-axe/issues/147#issuecomment-758804533

Additional context

https://github.com/jsdom/jsdom/issues/3025