1
- import { mount , render , shallow } from 'enzyme' ;
2
1
import { showDialog } from '@jupyterlab/apputils' ;
2
+ import ClearIcon from '@material-ui/icons/Clear' ;
3
+ import { mount , render , shallow } from 'enzyme' ;
3
4
import 'jest' ;
4
5
import * as React from 'react' ;
5
6
import { ActionButton } from '../../src/components/ActionButton' ;
@@ -8,7 +9,7 @@ import * as git from '../../src/git';
8
9
import { Logger } from '../../src/logger' ;
9
10
import { GitExtension } from '../../src/model' ;
10
11
import { listItemClass , nameClass } from '../../src/style/BranchMenu' ;
11
- import { mockedRequestAPI , defaultMockedResponses } from '../utils' ;
12
+ import { defaultMockedResponses , mockedRequestAPI } from '../utils' ;
12
13
13
14
jest . mock ( '../../src/git' ) ;
14
15
jest . mock ( '@jupyterlab/apputils' ) ;
@@ -130,7 +131,7 @@ describe('BranchMenu', () => {
130
131
component . setState ( {
131
132
filter : 'foo'
132
133
} ) ;
133
- const nodes = component . find ( ' ClearIcon' ) ;
134
+ const nodes = component . find ( ClearIcon ) ;
134
135
expect ( nodes . length ) . toEqual ( 1 ) ;
135
136
} ) ;
136
137
@@ -140,7 +141,7 @@ describe('BranchMenu', () => {
140
141
filter : 'foo'
141
142
} ) ;
142
143
const html = component
143
- . find ( ' ClearIcon' )
144
+ . find ( ClearIcon )
144
145
. first ( )
145
146
. html ( ) ;
146
147
expect ( html . includes ( '<title>' ) ) . toEqual ( true ) ;
@@ -167,7 +168,7 @@ describe('BranchMenu', () => {
167
168
168
169
// Should contain the branch names...
169
170
for ( let i = 0 ; i < branches . length ; i ++ ) {
170
- expect ( nodes [ i ] . lastChild . data ) . toEqual ( branches [ i ] . name ) ;
171
+ expect ( ( nodes [ i ] as any ) . lastChild . data ) . toEqual ( branches [ i ] . name ) ;
171
172
}
172
173
} ) ;
173
174
@@ -280,7 +281,7 @@ describe('BranchMenu', () => {
280
281
expect ( nodes . length ) . toEqual ( branches . length ) ;
281
282
282
283
for ( let i = 0 ; i < branches . length ; i ++ ) {
283
- expect ( nodes [ i ] . attribs [ 'title' ] . length ) . toBeGreaterThan ( 0 ) ;
284
+ expect ( ( nodes [ i ] as any ) . attribs [ 'title' ] . length ) . toBeGreaterThan ( 0 ) ;
284
285
}
285
286
} ) ;
286
287
0 commit comments