import { flushPromises, mount } from '@vue/test-utils' import ElementPlus, { ElMessage } from 'element-plus' import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' import Outbound from './Outbound.vue' const outboundStore = vi.hoisted(() => ({ outboundList: [], loading: false, page: { currentPage: 1, pageSize: 20, total: 0 }, fetchOutboundList: vi.fn(), fetchOutboundDetail: vi.fn(), createOutbound: vi.fn(), updateOutbound: vi.fn(), deleteOutbound: vi.fn() })) const materialsStore = vi.hoisted(() => ({ materialOptions: [], fetchMaterialOptions: vi.fn() })) const stockStore = vi.hoisted(() => ({ stockList: [], fetchAllStock: vi.fn(), fetchStockByMaterialId: vi.fn() })) vi.mock('../stores/outbound', () => ({ useOutboundStore: () => outboundStore })) vi.mock('../stores/materials', () => ({ useMaterialsStore: () => materialsStore })) vi.mock('../stores/stock', () => ({ useStockStore: () => stockStore })) vi.mock('../stores/auth', () => ({ useAuthStore: () => ({ isAdmin: true }) })) function mountOutbound() { return mount(Outbound, { global: { plugins: [ElementPlus], stubs: { teleport: true, ElSelect: { props: ['modelValue'], template: '