Fix incorrect commission calculation for non-EUR currencies #6

Closed
opened 11 months ago by inga-lovinde · 0 comments
Owner

Currently, tests fail with

  ● TransactionController Unit Tests › calling commission method correct commission should be got

    assert.strictEqual(received, expected)

    Expected value to strictly be equal to:
      "{\"amount\":\"4.17\",\"currency\":\"EUR\"}"
    Received:
      "{\"amount\":\"5.00\",\"currency\":\"EUR\"}"

    Message:
      expected '{"amount":"5.00","currency":"EUR"}' to deeply equal '{"amount":"4.17","currency":"EUR"}'

    Difference:

    - Expected
    + Received

    - {"amount":"4.17","currency":"EUR"}
    + {"amount":"5.00","currency":"EUR"}

       96 |     const result = await transactionController.commission(mockTransactionInput);
       97 |
    >  98 |     expect(result).to.eql('{"amount":"4.17","currency":"EUR"}');
          |                       ^
       99 |   });
      100 | });
      101 |

      at Object.<anonymous> (transaction/transaction.controller.spec.ts:98:23)

Currently, tests fail with ``` ● TransactionController Unit Tests › calling commission method correct commission should be got assert.strictEqual(received, expected) Expected value to strictly be equal to: "{\"amount\":\"4.17\",\"currency\":\"EUR\"}" Received: "{\"amount\":\"5.00\",\"currency\":\"EUR\"}" Message: expected '{"amount":"5.00","currency":"EUR"}' to deeply equal '{"amount":"4.17","currency":"EUR"}' Difference: - Expected + Received - {"amount":"4.17","currency":"EUR"} + {"amount":"5.00","currency":"EUR"} 96 | const result = await transactionController.commission(mockTransactionInput); 97 | > 98 | expect(result).to.eql('{"amount":"4.17","currency":"EUR"}'); | ^ 99 | }); 100 | }); 101 | at Object.<anonymous> (transaction/transaction.controller.spec.ts:98:23) ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: inga-lovinde/test-assignment-payments#6
Loading…
There is no content yet.