This commit is contained in:
2026-08-05 17:10:10 +08:00
parent 4b31eb7786
commit 6736893128
4 changed files with 129 additions and 55 deletions
@@ -239,6 +239,24 @@ describe('PalletsView', () => {
})
})
it('groups the pallet editor into clear ownership and specification sections', async () => {
const wrapper = await mountView()
const createButton = wrapper.findAll('button').find((button) => button.text().trim() === '新增托盘')
await createButton?.trigger('click')
await flushPromises()
expect(document.body.querySelector('.pallet-editor-header')?.textContent).toContain('新增托盘')
expect(document.body.querySelector('.pallet-editor-header')?.textContent).toContain('录入归属仓库与基础规格')
const editorDialog = document.body.querySelector('.pallet-editor-drawer[role="dialog"]')
const labelledBy = editorDialog?.getAttribute('aria-labelledby')
expect(labelledBy).toBeTruthy()
expect(document.getElementById(labelledBy || '')?.textContent).toBe('新增托盘')
expect(document.body.querySelectorAll('.editor-section')).toHaveLength(2)
expect(document.body.querySelector('#pallet-ownership-heading')?.textContent).toBe('归属仓库')
expect(document.body.querySelector('#pallet-spec-heading')?.textContent).toBe('托盘规格')
expect(document.body.querySelector('.pallet-editor-footer')?.textContent).toContain('为必填项')
})
it('hides all write actions without write permissions', async () => {
const wrapper = await mountView(['platform:pallet:list'])