From f5a43c1cfe62d0b2555520ae0291ec0f968cc8ef Mon Sep 17 00:00:00 2001
From: ouyangxq <775153912@qq.com>
Date: Wed, 9 Sep 2026 18:35:35 +0800
Subject: [PATCH] test: verify pallet label internal code dialog
---
.../components/PalletLabelPrintDialog.test.ts | 58 +++++++++++++++++++
.../components/PalletLabelPrintDialog.vue | 2 +-
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 src/modules/loading-lists/components/PalletLabelPrintDialog.test.ts
diff --git a/src/modules/loading-lists/components/PalletLabelPrintDialog.test.ts b/src/modules/loading-lists/components/PalletLabelPrintDialog.test.ts
new file mode 100644
index 00000000..71e0822b
--- /dev/null
+++ b/src/modules/loading-lists/components/PalletLabelPrintDialog.test.ts
@@ -0,0 +1,58 @@
+import { mount } from '@vue/test-utils'
+import { nextTick } from 'vue'
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+import PalletLabelPrintDialog from './PalletLabelPrintDialog.vue'
+
+const preparePalletLabels = vi.fn()
+
+vi.mock('../api/platformLoadingLists', () => ({
+ preparePalletLabels: (...args: unknown[]) => preparePalletLabels(...args),
+ printPalletLabels: vi.fn(),
+}))
+
+describe('PalletLabelPrintDialog', () => {
+ beforeEach(() => {
+ preparePalletLabels.mockReset().mockResolvedValue({
+ planId: '10', planNo: 'LP-1', containerNo: 'HLCU1723867', totalCount: 2,
+ groups: [{
+ destinationWarehouseCode: 'ACY2', destinationWarehouseInternalCode: '101',
+ destinationWarehouseName: 'ACY2', totalCount: 2,
+ labels: [
+ { palletCode: 'HLCU1723867-101-001' },
+ { palletCode: 'HLCU1723867-101-002' },
+ ],
+ }],
+ })
+ })
+
+ it('shows the server-generated internal code rule and both warehouse codes', async () => {
+ const wrapper = mount(PalletLabelPrintDialog, {
+ props: { planId: '10', warehouseId: '20' },
+ global: {
+ stubs: {
+ AppDialog: { template: '
{{ title }}
' }, + 'el-radio-group': { template: '