1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export function wrapsIntrinsicElement(reactWrapper) {
|
8 | return typeof reactWrapper.type() === 'string';
|
9 | }
|
10 | let warnedOnce = false;
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export default function findOutermostIntrinsic(reactWrapper) {
|
19 | if (!warnedOnce) {
|
20 | warnedOnce = true;
|
21 | console.warn(['Material-UI: the test utils are deprecated, they are no longer present in v5.', 'The helpers were designed to work with enzyme.', 'However, the tests of the core components were moved to react-testing-library.'].join('\n'));
|
22 | }
|
23 |
|
24 | return reactWrapper.findWhere(n => n.exists() && wrapsIntrinsicElement(n)).first();
|
25 | } |
\ | No newline at end of file |