优化
This commit is contained in:
@@ -65,6 +65,10 @@ describe('CustomerVisitsView permissions and visit material', () => {
|
||||
await wrapper.findAll('button').find(button => button.text() === '回访')!.trigger('click')
|
||||
await flushPromises()
|
||||
const input = wrapper.find('[data-dialog="客户回访"] input[type="file"]')
|
||||
const inputClick = vi.spyOn(input.element as HTMLInputElement, 'click').mockImplementation(() => {})
|
||||
await wrapper.findAll('button').find(button => button.text() === '选择文件')!.trigger('click')
|
||||
expect(inputClick).toHaveBeenCalledOnce()
|
||||
inputClick.mockRestore()
|
||||
const file = new File(['data'], 'visit.pdf', { type: 'application/pdf' })
|
||||
Object.defineProperty(input.element, 'files', { configurable: true, value: [file] })
|
||||
await input.trigger('change')
|
||||
|
||||
Reference in New Issue
Block a user