File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { mount , createLocalVue } from '@vue/test-utils'
2
2
import ExportDropDown from '@/components/ExportDropDown'
3
+ import EventHeader from '@/components/event/Header'
3
4
import flushPromises from 'flush-promises'
4
5
import BootstrapVue from 'bootstrap-vue'
6
+ import { EVENT_DATA } from '../utils'
5
7
6
8
const localVue = createLocalVue ( )
7
9
localVue . use ( BootstrapVue )
@@ -20,6 +22,16 @@ function createWrapper($http)
20
22
}
21
23
22
24
return mount ( ExportDropDown , {
25
+ parentComponent : {
26
+ name : 'EventHeader' ,
27
+ render ( createElement , context ) {
28
+ return createElement ( EventHeader , {
29
+ props : {
30
+ event : EVENT_DATA
31
+ }
32
+ } )
33
+ }
34
+ } ,
23
35
mocks : { $http, $store } ,
24
36
attachToDocument : true ,
25
37
localVue
@@ -43,11 +55,14 @@ describe('ExportDropDown.vue', () => {
43
55
} )
44
56
45
57
it ( 'Request xls file url' , async ( ) => {
58
+
46
59
wrapper . find ( '.dropdown-item' ) . trigger ( 'click' )
60
+
47
61
flushPromises ( ) . then ( ( ) => {
48
62
expect ( window . location . href ) . to . equal ( resp . response . data . data . url )
49
63
wrapper . trigger ( 'hide' )
50
64
} )
65
+
51
66
} )
52
67
53
68
} )
You can’t perform that action at this time.
0 commit comments