fix: 移除扫码页出证总开关
This commit is contained in:
@@ -2,7 +2,7 @@ import { DepositCertificateService } from './deposit-certificate.service';
|
||||
import { DepositProvider } from './deposit.provider';
|
||||
|
||||
const settings = {
|
||||
certificateEnabled: 'true', blockchainDriver: 'tianhe',
|
||||
blockchainDriver: 'tianhe',
|
||||
tianheEnv: 'test', tianheAppId: 'app', tianheAppKey: 'key', tianheWalletAddress: '0x' + 'a'.repeat(40),
|
||||
};
|
||||
function fixture(state = 'PENDING') {
|
||||
@@ -78,9 +78,9 @@ describe('Consumer certificate lifecycle', () => {
|
||||
await expect(service.request('123456000001')).rejects.toThrow();
|
||||
expect(prisma.$transaction).not.toHaveBeenCalled();
|
||||
});
|
||||
it('ignores obsolete daily settings and claims an item without any quota transaction', async () => {
|
||||
it('ignores the obsolete disabled switch and daily settings when claiming an item', async () => {
|
||||
const { service, prisma, config } = fixture('NONE');
|
||||
config.getAllRaw.mockResolvedValue({ ...settings, certificateDailyLimit: '0', certificateDailyQuota: '2026-09-20:999999' } as any);
|
||||
config.getAllRaw.mockResolvedValue({ ...settings, certificateEnabled: 'false', certificateDailyLimit: '0', certificateDailyQuota: '2026-09-20:999999' } as any);
|
||||
await service.request('123456000001');
|
||||
expect(prisma.blockchainProof.updateMany).toHaveBeenCalledWith(expect.objectContaining({
|
||||
where: { id: 1, certificateState: 'NONE', status: 'ONCHAIN' },
|
||||
|
||||
Reference in New Issue
Block a user