fix(admin): preserve tail-leg references
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { flushPromises, mount } from '@vue/test-utils'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import OrderReferenceText from './OrderReferenceText.vue'
|
||||
|
||||
describe('OrderReferenceText', () => {
|
||||
@@ -23,4 +23,15 @@ describe('OrderReferenceText', () => {
|
||||
expect(wrapper.text()).toBe('LMO-260827-0001')
|
||||
expect(wrapper.attributes('title')).toBe('LMO-260827-0001')
|
||||
})
|
||||
|
||||
it('copies the exact server short number without frontend formatting', async () => {
|
||||
const writeText = vi.fn().mockResolvedValue(undefined)
|
||||
vi.stubGlobal('navigator', { clipboard: { writeText } })
|
||||
const wrapper = mount(OrderReferenceText, { props: { value: 'LMO-9A7', copyable: true } })
|
||||
await wrapper.get('el-button').trigger('click')
|
||||
await flushPromises()
|
||||
expect(writeText).toHaveBeenCalledWith('LMO-9A7')
|
||||
expect(wrapper.attributes('title')).toBe('LMO-9A7')
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user