Skip to content

Commit 8f4276f

Browse files
committed
Misc improvements
- Adds findInDomManyByClass(..) function into jest utils (fix for topcoder-platform#9) - Excludes <Link> from jsx-a11y/anchor-is-valid rule of ESLint (fix for topcoder-platform#10)
1 parent 6a87105 commit 8f4276f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

config/eslint/default.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"settings": {
55
"import/resolver": {
66
"babel-module": {}
7-
}
7+
},
8+
"jsx-a11y/anchor-is-valid": ["error", {
9+
"components": [],
10+
"specialLink": ["hrefLeft", "hrefRight"],
11+
"aspects": ["invalidHref", "noHref", "preferButton"]
12+
}]
813
}
914
}

src/shared/utils/jest.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ export function findInDomByClass(dom, className) {
2727
return TU.findRenderedDOMComponentWithClass(dom, className);
2828
}
2929

30+
/**
31+
* Just an alias for TU.scryRenderedDOMComponentsWithClass(..).
32+
* @param {Object} dom
33+
* @param {Stirng} className
34+
* @return {Array}
35+
*/
36+
export function findInDomManyByClass(dom, className) {
37+
return TU.scryRenderedDOMComponentsWithClass(dom, className);
38+
}
39+
3040
/**
3141
* Auxiliary wrapper around ReactJS Test Renderer.
3242
* @param {Object} component ReactJS component to render.

0 commit comments

Comments
 (0)