Skip to content

Commit

Permalink
[DDW-821] Fixes import statement paths for transactions domain, adds …
Browse files Browse the repository at this point in the history
…flow
  • Loading branch information
MarcusHurney committed Aug 22, 2019
1 parent 87a2738 commit 517589b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 6 additions & 2 deletions tests/transactions/e2e/steps/transactions-steps.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// @flow
import { Given, When, Then } from 'cucumber';
import { expect } from 'chai';
import BigNumber from 'bignumber.js/bignumber';
import {
DECIMAL_PLACES_IN_ADA,
LOVELACES_PER_ADA,
} from '../../../../source/renderer/app/config/numbersConfig';
import { getVisibleTextsForSelector } from '../helpers/shared-helpers';
import { getWalletByName } from '../helpers/wallets-helpers';
import { getVisibleTextsForSelector } from '../../../common/e2e/steps/helpers';
import { getWalletByName } from '../../../wallets/e2e/steps/helpers';
import type { Daedalus } from '../../../types';

declare var daedalus: Daedalus;

// This step ensures sequential creation of given transactions
// use only when the order is important because it's slower!
Expand Down
13 changes: 10 additions & 3 deletions tests/transactions/e2e/steps/wallets-utxos-steps.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// @flow
import { Then } from 'cucumber';
import { expect } from 'chai';
import { BigNumber } from 'bignumber.js';
import { getVisibleTextsForSelector } from '../helpers/shared-helpers';
import { getVisibleTextsForSelector } from '../../../common/e2e/steps/helpers';
import { getWalletUtxosTotalAmount } from '../../../../source/renderer/app/utils/utxoUtils';
import type { Daedalus } from '../../../types';

declare var daedalus: Daedalus;

const container = '.WalletUtxo_container';

Expand Down Expand Up @@ -39,13 +43,16 @@ Then(
this.client,
selectors.walletUtxosAmount
);

const walletSettingsHistogram =
daedalus.stores.walletSettings.walletUtxos ?
daedalus.stores.walletSettings.walletUtxos.histogram :
null;
const {
value: { expextedWalletAmount, histogram },
} = await this.client.executeAsync(done =>
done({
expextedWalletAmount: daedalus.stores.wallets.activeValue,
histogram: daedalus.stores.walletSettings.walletUtxos.histogram,
histogram: walletSettingsHistogram,
})
);

Expand Down
3 changes: 2 additions & 1 deletion tests/transactions/unit/steps/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const getHistogramFromTable = data => {
// @flow
export const getHistogramFromTable = (data: Object) => {
let histogram = {};
data.hashes().forEach(({ walletAmount, walletUtxosAmount }) => {
histogram[walletAmount] = walletUtxosAmount;
Expand Down
2 changes: 1 addition & 1 deletion tests/transactions/unit/steps/utxos-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
getUtxoWalletPrettyAmount,
getWalletUtxosTotalAmount,
} from '../../../../source/renderer/app/utils/utxoUtils';
import { getHistogramFromTable } from '../setup/utxo-helpers';
import { getHistogramFromTable } from './helpers';

Given('the `getUtxoChartData` function receives the following props:', function(
data
Expand Down

0 comments on commit 517589b

Please sign in to comment.