From 8e8efec6f98f505fed23b371b21adee6b5356933 Mon Sep 17 00:00:00 2001 From: TheTrunk Date: Tue, 28 Jan 2025 08:07:25 +0700 Subject: [PATCH] correct tests --- tests/unit/actionApi.spec.ts | 4 ++-- tests/unit/syncApi.spec.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/actionApi.spec.ts b/tests/unit/actionApi.spec.ts index 7dd81a7..f36aca4 100644 --- a/tests/unit/actionApi.spec.ts +++ b/tests/unit/actionApi.spec.ts @@ -46,7 +46,7 @@ describe('Action API', function () { }); }); - it('should return Bad Request result c1walletidentityif stub value is invalid', async function () { + it('should return Invalid ID result bc1walletidentityif stub value is invalid', async function () { const request = httpMocks.createRequest({ method: 'GET', url: 'test', @@ -60,7 +60,7 @@ describe('Action API', function () { .stub(actionService, 'getAction') .returns({ wkIdentity: 'bc1walletidentity' }); await actionApi.getAction(request, res); - expect(res._getData()).to.deep.equal('Bad Request'); + expect(res._getData()).to.deep.equal('Invalid ID'); }); it('should return error result bc1walletidentity if stub value is valid', async function () { diff --git a/tests/unit/syncApi.spec.ts b/tests/unit/syncApi.spec.ts index b648e59..bcb4d2b 100644 --- a/tests/unit/syncApi.spec.ts +++ b/tests/unit/syncApi.spec.ts @@ -46,7 +46,7 @@ describe('Sync API', function () { }); }); - it('should return Bad Request result 141 if stub value is false', async function () { + it('should return Invalid ID result bc1walletidentity141 if stub value is false', async function () { const request = httpMocks.createRequest({ method: 'GET', url: 'test', @@ -58,10 +58,10 @@ describe('Sync API', function () { }); await sinon.stub(syncService, 'getSync').returns(false); await syncApi.getSync(request, res); - expect(res._getData()).to.deep.equal('Bad Request'); + expect(res._getData()).to.deep.equal('Invalid ID'); }); - it('should return Bad Request result bc1walletidentity141 if stub value is undefined', async function () { + it('should return Invalid ID result bc1walletidentity141 if stub value is undefined', async function () { const request = httpMocks.createRequest({ method: 'GET', url: 'test', @@ -73,10 +73,10 @@ describe('Sync API', function () { }); await sinon.stub(syncService, 'getSync').returns(undefined); await syncApi.getSync(request, res); - expect(res._getData()).to.deep.equal('Bad Request'); + expect(res._getData()).to.deep.equal('Invalid ID'); }); - it('should return Bad Request result bc1walletidentity141 if stub value is null', async function () { + it('should return Invalid ID result bc1walletidentity141 if stub value is null', async function () { const request = httpMocks.createRequest({ method: 'GET', url: 'test', @@ -88,7 +88,7 @@ describe('Sync API', function () { }); await sinon.stub(syncService, 'getSync').returns(null); await syncApi.getSync(request, res); - expect(res._getData()).to.deep.equal('Bad Request'); + expect(res._getData()).to.deep.equal('Invalid ID'); }); });