fix: clarify signature reporting status
This commit is contained in:
@@ -128,4 +128,20 @@ describe('DictionariesService', () => {
|
||||
);
|
||||
expect(prisma.drainageField.create).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('only accepts Arabic numerals and English letters in report field codes', async () => {
|
||||
const prisma = createPrismaMock();
|
||||
const service = new DictionariesService(prisma as never);
|
||||
|
||||
await expect(service.createDrainageField({ code: 'License2026', name: '营业执照', fieldType: 'image' })).resolves.toEqual(
|
||||
expect.objectContaining({ code: 'License2026' }),
|
||||
);
|
||||
expect(() => service.createDrainageField({ code: 'license_code', name: '营业执照', fieldType: 'image' })).toThrow(
|
||||
'code must contain only Arabic numerals and English letters',
|
||||
);
|
||||
expect(() => service.createDrainageField({ code: '营业执照', name: '营业执照', fieldType: 'image' })).toThrow(
|
||||
'code must contain only Arabic numerals and English letters',
|
||||
);
|
||||
expect(prisma.drainageField.create).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user