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

Function expectElementToHaveOneOfStyles

tests/utils/index.js:308–321  ·  view source on GitHub ↗
(element, styles)

Source from the content-addressed store, hash-verified

306 * @param {{}[]} styles
307 */
308export const expectElementToHaveOneOfStyles = (element, styles) => {
309 const styleCount = styles.length;
310 for (let i = 0; i < styleCount; i++) {
311 const success = testElementToHaveStyle(element, styles[i]);
312
313 if (success) {
314 return expectElementToHaveStyle(element, styles[i]);
315 }
316 }
317
318 // non of the provided styles are available, report error
319 // todo report which styles were tried, and what were the diffs
320 fail("Non of the provided styles matched the element's style.");
321};
322
323/**
324 * @param {{}[]} styles

Callers 1

Calls 2

testElementToHaveStyleFunction · 0.85
expectElementToHaveStyleFunction · 0.85

Tested by

no test coverage detected