MCPcopy Create free account
hub / github.com/ZeeCoder/container-query / expectElementToHaveStyle

Function expectElementToHaveStyle

tests/utils/index.js:76–81  ·  view source on GitHub ↗
(element, style)

Source from the content-addressed store, hash-verified

74 * @param {{}} style
75 */
76export const expectElementToHaveStyle = (element, style) => {
77 const computedStyle = getComputedStyle(element);
78 for (let prop of Object.keys(style)) {
79 expect(computedStyle[prop]).toBe(style[prop]);
80 }
81};
82
83/**
84 * Asserts whether the currently rendered component has the expected styles.

Callers 5

index.jsFile · 0.90
loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected