Skip to content

Commit

Permalink
test(link-list): update utils (#7692)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

none 
### Description

Add a utils folder within cypress and update link-list tests



<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
ariellalgilmore authored Nov 18, 2021
1 parent a5bb87e commit 92912bb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import getCssPropertyForRule from '../../../../utils/get-css-property-for-rule';
import getCssPropertyForRule from '../../utils/get-css-property-for-rule';

/**
* Sets the correct path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import getCssPropertyForRule from '../../../../utils/get-css-property-for-rule';
import getCssPropertyForRule from '../../utils/get-css-property-for-rule';

/**
* Sets the correct path
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright IBM Corp. 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export default function getCssPropertyForRule(rule, prop, sheets) {
const slen = sheets.length;
for (let i = 0; i < slen; i++) {
let rules;
try {
rules = sheets[i].cssRules;
} catch (e) {
continue;
}
const rlen = rules.length;
for (let j = 0; j < rlen; j++) {
if (rules[j].selectorText === rule) {
return rules[j].style[prop];
}
}
}
}
33 changes: 0 additions & 33 deletions packages/web-components/tests/utils/get-css-property-for-rule.ts

This file was deleted.

0 comments on commit 92912bb

Please sign in to comment.