File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -5,29 +5,30 @@ import { Styles, EditorProvider } from '../src'
5
5
6
6
afterEach ( cleanup )
7
7
8
- if ( global . document ) {
9
- document . createRange = ( ) => ( {
10
- setStart : ( ) => { } ,
11
- setEnd : ( ) => { } ,
12
- commonAncestorContainer : {
13
- nodeName : 'BODY' ,
14
- ownerDocument : document ,
15
- } ,
16
- } )
8
+ if ( ( global as any ) . document ) {
9
+ document . createRange = ( ) =>
10
+ ( ( {
11
+ setStart : ( ) => { } ,
12
+ setEnd : ( ) => { } ,
13
+ commonAncestorContainer : {
14
+ nodeName : 'BODY' ,
15
+ ownerDocument : document ,
16
+ } ,
17
+ } as unknown ) as Range )
17
18
}
18
19
19
20
const theme = {
20
21
styles : {
21
22
root : { } ,
22
23
h1 : { } ,
23
- }
24
+ } ,
24
25
}
25
26
26
27
test ( 'edits styles.root.fontFamily' , async ( ) => {
27
28
let context
28
29
const GetContext = ( ) => {
29
30
context = useThemeUI ( )
30
- return false
31
+ return null
31
32
}
32
33
const tree = render (
33
34
< EditorProvider theme = { theme } >
@@ -39,7 +40,7 @@ test('edits styles.root.fontFamily', async () => {
39
40
fireEvent . change ( input , {
40
41
target : {
41
42
value : 'system-ui' ,
42
- }
43
+ } ,
43
44
} )
44
45
expect ( context . theme . styles . root . fontFamily ) . toBe ( 'system-ui' )
45
46
} )
You can’t perform that action at this time.
0 commit comments