blessing-skin-server/resources/assets/tests/views/user/Report.test.ts
2019-11-21 09:33:28 +08:00

18 lines
483 B
TypeScript

import Vue from 'vue'
import { mount } from '@vue/test-utils'
import { flushPromises } from '../../utils'
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)
await flushPromises()
expect(wrapper.find('a').attributes('href')).toBe('/skinlib/show/1')
expect(wrapper.text()).toContain('report.status.1')
})