import {expect,it,vi} from 'vitest'
import {defineComponent,ref,computed} from 'vue'
import {mount,shallowMount} from '@vue/test-utils'
import ElementPlus from 'element-plus'
import SidebarItem from '../../src/layout/components/Sidebar/SidebarItem.vue'
import Results from '../../src/components/BusinessAssistant/AssistantResults.vue'
vi.mock('@/store/modules/businessAssistant',()=>({default:()=>({open:true,generation:1})}))
vi.mock('@/api/warehouse/assistant',()=>({getAssistantGeneratedFile:vi.fn()}))
vi.mock('@vueuse/core',()=>({useElementSize:()=>({width:680,height:500})}))
it('collapsed category and leaf menu items retain accessible names',()=>{
vi.stubGlobal('ref',ref)
vi.stubGlobal('computed',computed)
const host=defineComponent({components:{SidebarItem},template:'',setup:()=>({item:{path:'stock',alwaysShow:true,meta:{title:'库存管理',icon:'stock'},children:[{path:'stock',meta:{title:'库存查询',icon:'stock'}}]}})})
const wrapper=mount(host,{global:{plugins:[ElementPlus],stubs:{AppLink:{template:''},SvgIcon:true}}})
expect(wrapper.get('[role="menuitem"]').attributes('aria-label')).toBe('库存管理')
wrapper.unmount();vi.unstubAllGlobals()
})
it('inventory technical fields can be expanded without replacing result data or losing zero values',async()=>{
const table=defineComponent({template:'