Skip to content

Commit 1faeb26

Browse files
author
Arman
committed
geophystech#137 ExportDropDown.
1 parent 258b5f7 commit 1faeb26

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/unit/specs/ExportDropDown.spec.js

+15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { mount, createLocalVue } from '@vue/test-utils'
22
import ExportDropDown from '@/components/ExportDropDown'
3+
import EventHeader from '@/components/event/Header'
34
import flushPromises from 'flush-promises'
45
import BootstrapVue from 'bootstrap-vue'
6+
import {EVENT_DATA} from '../utils'
57

68
const localVue = createLocalVue()
79
localVue.use(BootstrapVue)
@@ -20,6 +22,16 @@ function createWrapper($http)
2022
}
2123

2224
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+
},
2335
mocks: { $http, $store },
2436
attachToDocument: true,
2537
localVue
@@ -43,11 +55,14 @@ describe('ExportDropDown.vue', () => {
4355
})
4456

4557
it('Request xls file url', async () => {
58+
4659
wrapper.find('.dropdown-item').trigger('click')
60+
4761
flushPromises().then(() => {
4862
expect(window.location.href).to.equal(resp.response.data.data.url)
4963
wrapper.trigger('hide')
5064
})
65+
5166
})
5267

5368
})

0 commit comments

Comments
 (0)