test(admin): cover optional legal-person qualification
This commit is contained in:
@@ -377,7 +377,7 @@ describe('platform IAM roles', () => {
|
||||
expect(http.post).toHaveBeenNthCalledWith(2, '/platform/v1/iam/tenants/8/submit-review', {})
|
||||
})
|
||||
|
||||
it('uploads both required files and the credit code in one package request', async () => {
|
||||
it('uploads the business license, credit code and optional legal-person ID in one package request', async () => {
|
||||
const result = {
|
||||
businessLicenseQualificationId: '91', legalPersonIdQualificationId: '92',
|
||||
tenantStatus: 'PROFILE_REQUIRED', businessLicenseDocumentUrl: '/license.pdf',
|
||||
@@ -400,6 +400,26 @@ describe('platform IAM roles', () => {
|
||||
expect(form.get('replaceLegalPersonId')).toBe('true')
|
||||
})
|
||||
|
||||
it('omits the optional legal-person ID parts when only the business license is uploaded', async () => {
|
||||
const result = {
|
||||
businessLicenseQualificationId: '91', legalPersonIdQualificationId: null,
|
||||
tenantStatus: 'PROFILE_REQUIRED', businessLicenseDocumentUrl: '/license.pdf',
|
||||
legalPersonIdDocumentUrl: null,
|
||||
}
|
||||
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: result })
|
||||
const businessLicense = new File(['%PDF-1.4'], '营业执照.pdf', { type: 'application/pdf' })
|
||||
|
||||
await expect(uploadPlatformTenantRequiredQualificationPackage(
|
||||
'8', businessLicense, null, '91440300MA5ABCDE12', true, false,
|
||||
)).resolves.toEqual(result)
|
||||
|
||||
const form = vi.mocked(http.post).mock.calls[0]?.[1] as FormData
|
||||
expect(form.get('businessLicense')).toBe(businessLicense)
|
||||
expect(form.get('legalPersonId')).toBeNull()
|
||||
expect(form.get('replaceBusinessLicense')).toBe('true')
|
||||
expect(form.get('replaceLegalPersonId')).toBeNull()
|
||||
})
|
||||
|
||||
it('preserves long review identifiers and returns one-time administrator credentials', async () => {
|
||||
const reviewId = '190000000000000001'
|
||||
const approval = {
|
||||
|
||||
Reference in New Issue
Block a user