16 lines
990 B
JavaScript
16 lines
990 B
JavaScript
|
|
import { mount } from '@vue/test-utils'
|
||
|
|
import { defineComponent } from 'vue'
|
||
|
|
import { test, expect } from 'vitest'
|
||
|
|
import Attachments from '@/components/BusinessAssistant/AssistantAttachments.vue'
|
||
|
|
import { assistantSheetSelection } from '@/utils/business-assistant'
|
||
|
|
|
||
|
|
test('opaque product Excel stays a file card without worksheet parsing UI', () => {
|
||
|
|
const files = [{ id: 'product-file', name: '图纸和清单.xlsx', type: 'document', productFileOnly: true, businessFileOnly: true }]
|
||
|
|
const wrapper = mount(Attachments, { props: { files, validation: assistantSheetSelection(files) }, global: { stubs: { ElButton: defineComponent({ template: '<button><slot/></button>' }), ElIcon: true } } })
|
||
|
|
expect(wrapper.text()).toContain('图纸和清单.xlsx')
|
||
|
|
expect(wrapper.text()).not.toContain('读取工作表')
|
||
|
|
expect(wrapper.text()).not.toContain('超过上限')
|
||
|
|
expect(wrapper.find('button').attributes('aria-label')).toContain('移除图纸和清单.xlsx')
|
||
|
|
wrapper.unmount()
|
||
|
|
})
|