diff --git a/server/models/Trust.spec.js b/server/models/Trust.spec.js index 00b92b67..ff5305e4 100644 --- a/server/models/Trust.spec.js +++ b/server/models/Trust.spec.js @@ -571,7 +571,13 @@ describe('Trust Model', () => { walletId: walletId3, }); expect(getTrustRelationshipsStub).calledThrice; - expect(getAllWalletStub).calledOnceWithExactly(walletId1); + expect(getAllWalletStub).calledOnceWithExactly( + walletId1, + undefined, + undefined, + 'created_at', + 'desc', + ); }); it('updateTrustState', async () => { @@ -913,7 +919,7 @@ describe('Trust Model', () => { describe('getTrustRelationshipById', () => { const walletId = uuid(); - const trustRelationshipId = uuid() + const trustRelationshipId = uuid(); const filter = { and: [ { @@ -933,12 +939,12 @@ describe('Trust Model', () => { trustRepositoryStub.getByFilter.resolves(['trustRelationship']); const result = await trustModel.getTrustRelationshipById({ walletId, - trustRelationshipId + trustRelationshipId, }); expect(result).eql('trustRelationship'); - expect(trustRepositoryStub.getByFilter).calledOnceWithExactly( - {...filter} - ); + expect(trustRepositoryStub.getByFilter).calledOnceWithExactly({ + ...filter, + }); }); - }) + }); }); diff --git a/server/services/TokenService.spec.js b/server/services/TokenService.spec.js index c391cb03..b646fdfa 100644 --- a/server/services/TokenService.spec.js +++ b/server/services/TokenService.spec.js @@ -204,8 +204,8 @@ describe('Token', () => { 'walletLoginId', undefined, undefined, - false, - false, + 'created_at', + 'desc', ), ).eql(true); }); @@ -223,8 +223,8 @@ describe('Token', () => { 'walletLoginId', undefined, undefined, - false, - false, + 'created_at', + 'desc', ), ).eql(true); }); diff --git a/server/services/TrustService.spec.js b/server/services/TrustService.spec.js index 22b41f0a..5332977c 100644 --- a/server/services/TrustService.spec.js +++ b/server/services/TrustService.spec.js @@ -24,8 +24,8 @@ describe('TrustService', () => { .resolves(['trustRelationships']); const getWalletStub = sinon - .stub(WalletService.prototype, 'getWallet') - .resolves({id: 'walletId'}) + .stub(WalletService.prototype, 'getWallet') + .resolves({ id: 'walletId' }); const trustRelationship = await trustService.getTrustRelationships({ walletId: 'walletId', @@ -33,13 +33,15 @@ describe('TrustService', () => { type: 'type', request_type: 'request_type', limit: 1, - offset: 0 + offset: 0, }); expect(trustRelationship).eql(['trustRelationships']); - expect(getWalletStub.calledOnceWithExactly({ + expect( + getWalletStub.calledOnceWithExactly({ walletId: 'walletId', - })) + }), + ); expect( getTrustRelationshipsStub.calledOnceWithExactly({ walletId: 'walletId', @@ -145,7 +147,15 @@ describe('TrustService', () => { { id: 'trustId5' }, { id: 'trustId6' }, ]); - expect(getAllWalletsStub.calledOnceWithExactly('walletId')).eql(true); + expect( + getAllWalletsStub.calledOnceWithExactly( + 'walletId', + undefined, + undefined, + 'created_at', + 'desc', + ), + ).eql(true); expect( getTrustRelationshipsStub.getCall(0).calledWithExactly({ walletId: 'id1', @@ -228,21 +238,21 @@ describe('TrustService', () => { }); describe('trustRelationshipGetById', async () => { - const trustRelationshipGetByIdStub = sinon - .stub(Trust.prototype, 'trustRelationshipGetById') - .resolves('trustRelationship'); + const trustRelationshipGetByIdStub = sinon + .stub(Trust.prototype, 'trustRelationshipGetById') + .resolves('trustRelationship'); - const trustRelationship = await trustService.trustRelationshipGetById({ - walletId: 'walletId', - trustRelationshipId: 'id' - }); + const trustRelationship = await trustService.trustRelationshipGetById({ + walletId: 'walletId', + trustRelationshipId: 'id', + }); - expect(trustRelationship).eql('trustRelationship'); - expect( - trustRelationshipGetByIdStub.calledOnceWithExactly({ - walletId: 'walletId', - trustRelationshipId: 'id' - }), - ).eql(true); - }) + expect(trustRelationship).eql('trustRelationship'); + expect( + trustRelationshipGetByIdStub.calledOnceWithExactly({ + walletId: 'walletId', + trustRelationshipId: 'id', + }), + ).eql(true); + }); });