Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kpoke committed Nov 3, 2022
1 parent 776d6b8 commit 866802a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion __tests__/trust-relationship-send.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chai.use(require('chai-uuid'));

const { apiKey } = seed;

describe.only('Trust relationship: send', () => {
describe('Trust relationship: send', () => {
let bearerToken;
let bearerTokenB;

Expand Down
2 changes: 1 addition & 1 deletion server/models/Transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class Transfer {
(hasControlOverSender && hasControlOverReceiver) ||
(!isDeduct && hasTrust)
) {
const transfer = await this.create({
const transfer = await this._transferRepository.create({
originator_wallet_id: walletLoginId,
source_wallet_id: sender.id,
destination_wallet_id: receiver.id,
Expand Down
15 changes: 8 additions & 7 deletions server/models/Transfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,18 @@ describe('Transfer Model', () => {
const receiverId = uuid();
const walletLoginId = uuid();
const transferId = uuid();

hasControlOverStub.onCall(0).resolves(true);
hasControlOverStub.onCall(1).resolves(true);
isDeductStub.resolves(true);
hasTrustStub.resolves(true);
const transferResult = {
id: transferId,
originator_wallet_id: walletLoginId,
source_wallet_id: senderId,
};
transferCreateStub.resolves(transferResult);
transferRepositoryStub.create.resolves(transferResult);

hasControlOverStub.onCall(0).resolves(true);
hasControlOverStub.onCall(1).resolves(true);
isDeductStub.resolves(true);
hasTrustStub.resolves(true);

const tokens = [{ id: uuid() }, { id: uuid() }];
getTokensByBundleStub.resolves(tokens);

Expand Down Expand Up @@ -644,7 +645,7 @@ describe('Transfer Model', () => {
walletLoginId,
receiverId,
]);
expect(transferCreateStub).calledOnceWithExactly({
expect(transferRepositoryStub.create).calledOnceWithExactly({
originator_wallet_id: walletLoginId,
source_wallet_id: senderId,
destination_wallet_id: receiverId,
Expand Down

0 comments on commit 866802a

Please sign in to comment.