新增手工开票 MING SONG 公司选项
This commit is contained in:
@@ -527,6 +527,52 @@ describe('ReservationManualInvoiceView', () => {
|
||||
expect(wrapper.find('a[href="https://oss.example/invoices/manual-91001.pdf"]').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('prefills MING SONG directory data and submits its stable recipient codes', async () => {
|
||||
vi.mocked(service.generateManualReservationInvoice).mockResolvedValue(createResult())
|
||||
const wrapper = mountView()
|
||||
|
||||
await wrapper.find('[data-testid="recipient-company-code"]').setValue('MING_SONG')
|
||||
|
||||
expect((wrapper.find('[data-testid="recipient-contact-id"]').element as HTMLSelectElement).value).toBe(
|
||||
'MING_SONG_KHUN_JIN',
|
||||
)
|
||||
expect((wrapper.find('[data-testid="recipient-company-input"]').element as HTMLInputElement).value).toBe(
|
||||
'MING SONG CO.LTD',
|
||||
)
|
||||
expect((wrapper.find('[data-testid="recipient-attention-input"]').element as HTMLInputElement).value).toBe(
|
||||
'KHUN JIN',
|
||||
)
|
||||
expect((wrapper.find('[data-testid="recipient-address"]').element as HTMLTextAreaElement).value).toBe(
|
||||
'290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
|
||||
)
|
||||
expect((wrapper.find('[data-testid="recipient-telephone"]').element as HTMLInputElement).value).toBe(
|
||||
'098-2519896',
|
||||
)
|
||||
expect((wrapper.find('[data-testid="recipient-email"]').element as HTMLInputElement).value).toBe(
|
||||
'taiziyoutravel@gmail.com',
|
||||
)
|
||||
|
||||
await fillMinimumInvoiceForm(wrapper)
|
||||
await wrapper.find('[data-testid="manual-invoice-submit"]').trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(service.generateManualReservationInvoice).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
invoice_payload: expect.objectContaining({
|
||||
recipient: expect.objectContaining({
|
||||
company_code: 'MING_SONG',
|
||||
contact_id: 'MING_SONG_KHUN_JIN',
|
||||
company: 'MING SONG CO.LTD',
|
||||
attention: 'KHUN JIN',
|
||||
address: '290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
|
||||
telephone: '098-2519896',
|
||||
email: 'taiziyoutravel@gmail.com',
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('downloads the generated PDF through a browser blob URL', async () => {
|
||||
vi.mocked(service.generateManualReservationInvoice).mockResolvedValue(createResult())
|
||||
const fetchMock = vi.fn().mockResolvedValue({
|
||||
|
||||
@@ -870,6 +870,19 @@ const recipientCompanies: RecipientCompanySeed[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
company_code: 'MING_SONG',
|
||||
company: 'MING SONG CO.LTD',
|
||||
contacts: [
|
||||
{
|
||||
contact_id: 'MING_SONG_KHUN_JIN',
|
||||
attention: 'KHUN JIN',
|
||||
address: '290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
|
||||
telephone: '098-2519896',
|
||||
email: 'taiziyoutravel@gmail.com',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
company_code: 'HANATOUR',
|
||||
company: 'HANATOUR TD CO., LTD.',
|
||||
|
||||
Reference in New Issue
Block a user