File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
react/MuiCozyTheme/TextField Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import React , { forwardRef } from 'react'
2
+ import MuiTextField from '@material-ui/core/TextField'
3
+
4
+ const TextField = forwardRef ( ( { children, ...props } , ref ) => {
5
+ // A11Y, https://v4.mui.com/api/text-field/#props
6
+ const uuid = crypto . randomUUID ( )
7
+
8
+ return (
9
+ < MuiTextField ref = { ref } id = { uuid } { ...props } >
10
+ { children }
11
+ </ MuiTextField >
12
+ )
13
+ } )
14
+
15
+ TextField . displayName = 'TextField'
16
+
17
+ export default TextField
Original file line number Diff line number Diff line change 1
1
import '@testing-library/jest-dom/extend-expect'
2
2
import { configure , mount , shallow } from 'enzyme'
3
3
import Adapter from 'enzyme-adapter-react-16'
4
+ import nodeCrypto from 'crypto'
4
5
5
6
configure ( { adapter : new Adapter ( ) } )
6
7
8
+ Object . defineProperty ( global , 'crypto' , {
9
+ value : {
10
+ randomUUID : ( ) => nodeCrypto . randomUUID ( )
11
+ }
12
+ } )
13
+
7
14
global . mount = mount
8
15
global . shallow = shallow
9
16
You can’t perform that action at this time.
0 commit comments