1 | import * as React from 'react';
|
2 | import createShallow from './createShallow';
|
3 | const shallow = createShallow();
|
4 | let warnedOnce = false;
|
5 |
|
6 | export default function getClasses(element) {
|
7 | if (!warnedOnce) {
|
8 | warnedOnce = true;
|
9 | 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'));
|
10 | }
|
11 |
|
12 | const {
|
13 | useStyles
|
14 | } = element.type;
|
15 | let classes;
|
16 |
|
17 | function Listener() {
|
18 | classes = useStyles(element.props);
|
19 | return null;
|
20 | }
|
21 |
|
22 | shallow( React.createElement(Listener, null));
|
23 | return classes;
|
24 | } |
\ | No newline at end of file |