Skip to content

Commit

Permalink
fixed the test
Browse files Browse the repository at this point in the history
  • Loading branch information
rsercano committed Nov 26, 2020
1 parent b626a70 commit 28defd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/service/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ class Service extends EventEmitter {
private structAlertMessage = (type: AlertType, payload: ChannelBalanceAlert | BalanceAlert) => {
switch (type) {
case AlertType.LowChannelBalance:
return `${BalanceSide[payload.side || 0]} channel balance (${satsToCoinsStr(payload.sideBalance || 0)}) of one of the channels is lower than 10% of channel capacity (${satsToCoinsStr(payload.totalBalance || 0)})`;
return `${BalanceSide[payload.side || 0]} channel balance (${satsToCoinsStr(payload.sideBalance || 0)} ${payload.currency}) of one of the channels is lower than 10% of channel capacity (${satsToCoinsStr(payload.totalBalance || 0)} ${payload.currency})`;
case AlertType.LowTradingBalance:
return `${BalanceSide[payload.side || 0]} trading balance (${satsToCoinsStr(payload.sideBalance || 0)}) is lower than 10% of trading capacity (${satsToCoinsStr(payload.totalBalance || 0)})`;
return `${BalanceSide[payload.side || 0]} trading balance (${satsToCoinsStr(payload.sideBalance || 0)} ${payload.currency}) is lower than 10% of trading capacity (${satsToCoinsStr(payload.totalBalance || 0)} ${payload.currency})`;
default:
return 'unknown alert type';
}
Expand Down
2 changes: 1 addition & 1 deletion test/jest/LndClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe('LndClient', () => {
);

expect(emit).toHaveBeenCalledTimes(1);
expect(emit).toHaveBeenCalledWith('lowBalance', {
expect(emit).toHaveBeenCalledWith('lowTradingBalance', {
totalBalance,
currency,
side: BalanceSide.Local,
Expand Down

0 comments on commit 28defd0

Please sign in to comment.