File tree Expand file tree Collapse file tree 1 file changed +8
-20
lines changed
redisinsight/ui/src/pages/browser/components/virtual-tree Expand file tree Collapse file tree 1 file changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const mockedItems = [
16
16
} ,
17
17
]
18
18
19
- export const mockVirtualTreeResult = [ {
19
+ const mockTreeItem = {
20
20
children : [ {
21
21
children : [ ] ,
22
22
fullName : 'car:110:' ,
@@ -30,34 +30,22 @@ export const mockVirtualTreeResult = [{
30
30
keyApproximate : 47.18 ,
31
31
keyCount : 4718 ,
32
32
name : 'car' ,
33
- } ,
34
- {
33
+ }
34
+
35
+ const mockTreeItem2 = {
35
36
children : [ ] ,
36
37
fullName : 'test' ,
37
38
id : '0.snc1rc3zwg1o' ,
38
39
keyApproximate : 0.01 ,
39
40
keyCount : 1 ,
40
41
name : 'test' ,
41
- } ]
42
+ }
42
43
43
- export const mockVirtualTreeResult1 = [ {
44
- children : [ {
45
- children : [ ] ,
46
- fullName : 'car:110:' ,
47
- id : '0.snc1rc3zwgo' ,
48
- keyApproximate : 0.01 ,
49
- keyCount : 1 ,
50
- name : '110' ,
51
- } ] ,
52
- fullName : 'car:' ,
53
- id : '0.sz1ie1koqi8' ,
54
- keyApproximate : 47.18 ,
55
- keyCount : 4718 ,
56
- name : 'car' ,
57
- } ]
44
+ export const mockVirtualTreeResult = [ mockTreeItem , mockTreeItem2 ]
58
45
59
46
jest . mock ( 'uiSrc/services' , ( ) => ( {
60
47
...jest . requireActual ( 'uiSrc/services' ) ,
48
+ __esModule : true ,
61
49
useDisposableWebworker : jest . fn ( ( ) => ( { result : mockVirtualTreeResult , run : jest . fn ( ) } ) )
62
50
} ) )
63
51
@@ -94,7 +82,7 @@ describe('VirtualTree', () => {
94
82
95
83
it ( 'should call onStatusOpen if only one folder is exist' , ( ) => {
96
84
( useDisposableWebworker as jest . Mock ) . mockReturnValueOnce ( {
97
- result : mockVirtualTreeResult1 ,
85
+ result : [ mockTreeItem ] ,
98
86
run : jest . fn ( )
99
87
} )
100
88
const mockFn = jest . fn ( )
You can’t perform that action at this time.
0 commit comments