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

Function testElementToHaveCustomProperties

tests/utils/index.js:181–194  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

179 * @return {boolean}
180 */
181export const testElementToHaveCustomProperties = (element, props) => {
182 // Not all browsers tested here support custom css properties
183 if (!areCustomCssPropertiesSupported()) {
184 return true;
185 }
186
187 for (let prop of Object.keys(props)) {
188 if (element.style.getPropertyValue(prop) !== props[prop]) {
189 return false;
190 }
191 }
192
193 return true;
194};
195
196/**
197 * @param {{}} props

Callers 1

loopFunction · 0.85

Calls 2

getPropertyValueMethod · 0.80

Tested by

no test coverage detected