/** * features/chat/components/shipping-review/ReviewUnsavedSwitchDialog.spec.ts * 用途:验收切换 OT 未保存硬拦截三按钮。 */ import { describe, expect, it } from 'vitest'; import { mount } from '@vue/test-utils'; import { createI18n } from 'vue-i18n'; import ReviewUnsavedSwitchDialog from './ReviewUnsavedSwitchDialog.vue'; const i18n = createI18n({ legacy: false, locale: 'zh-CN', messages: { 'zh-CN': { chat: { shippingOrderReview: { unsavedSwitch: { title: '有未保存的修改', message: '当前订单有 {count} 项修改尚未保存。', cancel: '取消', discard: '放弃修改', saveAndSwitch: '保存后切换', }, }, }, }, }, }); describe('ReviewUnsavedSwitchDialog', () => { it('emits cancel / discard / save-and-switch', async () => { const wrapper = mount(ReviewUnsavedSwitchDialog, { props: { open: true, unsavedCount: 2 }, global: { plugins: [i18n], stubs: { Teleport: { template: '