2019-03-30 11:38:30 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
import { mount } from '@vue/test-utils'
|
2019-11-21 09:33:28 +08:00
|
|
|
import { flushPromises } from '../../utils'
|
2019-03-30 11:38:30 +08:00
|
|
|
import Report from '@/views/user/Report.vue'
|
|
|
|
|
|
|
|
test('basic render', async () => {
|
|
|
|
Vue.prototype.$http.get.mockResolvedValue([
|
|
|
|
{
|
|
|
|
id: 1, tid: 1, reason: 'abc', status: 1,
|
|
|
|
},
|
|
|
|
])
|
|
|
|
const wrapper = mount(Report)
|
2019-11-21 09:33:28 +08:00
|
|
|
await flushPromises()
|
2019-03-30 11:38:30 +08:00
|
|
|
|
|
|
|
expect(wrapper.find('a').attributes('href')).toBe('/skinlib/show/1')
|
|
|
|
expect(wrapper.text()).toContain('report.status.1')
|
|
|
|
})
|