Skip to content
Permalink
Browse files

[DDW-738] Refactor V2 API test setup (#1553)

* [DDW-860] Introduce improvements for already integrated wallets API v2 endpoint

* [DDW-860] Wallets endpoint flow code cleanup and removing unnecessary assurance declarations

* [DDW-860] Introduce improvements for already integrated getAddresses API v2 endpoint

* [DDW-680] Fix broken transactions screen

* [DDW-860] Types improvements regarding to requested changes

* [DDW-861] Introduce new error handling logic related to api v2 responsees

* [DDW-861] Fix flow issue

* [DDW-861] Shortens .map callback functions

* [DDW-861] Fixes ESLint error

* [DDW-871] Introduce Delete Wallet v2 API endpoint integration

* [DDW-739] Introduce refactored e2e testReset method

* CHANGELOG update

* [DDW-738] CHANGELOG update

* [DDW-871] Eslint fix
  • Loading branch information...
tomothespian authored and nikolaglumac committed Sep 12, 2019
1 parent 804fb23 commit 85319ff273837957e8831248ed69fe572371df2d
@@ -5,7 +5,7 @@ Changelog

### Features

- Integrated Cardano V2 API endpoints ([PR 1548](https://github.com/input-output-hk/daedalus/pull/1548), [PR 1551](https://github.com/input-output-hk/daedalus/pull/1551), [PR 1552](https://github.com/input-output-hk/daedalus/pull/1552))
- Integrated Cardano V2 API endpoints ([PR 1548](https://github.com/input-output-hk/daedalus/pull/1548), [PR 1551](https://github.com/input-output-hk/daedalus/pull/1551), [PR 1552](https://github.com/input-output-hk/daedalus/pull/1552), [PR 1553](https://github.com/input-output-hk/daedalus/pull/1553))
- Removed select dropdown arrow ([PR 1550](https://github.com/input-output-hk/daedalus/pull/1550))
- Implemented automated and manual update flows unification ([PR 1491](https://github.com/input-output-hk/daedalus/pull/1491))
- Updated behavior of system dialogs ([PR 1494](https://github.com/input-output-hk/daedalus/pull/1494))
@@ -32,7 +32,6 @@ import { getTransactionFee } from './transactions/requests/getTransactionFee';
import { createTransaction } from './transactions/requests/createTransaction';

// Wallets requests
import { resetWalletState } from './wallets/requests/resetWalletState';
import { changeSpendingPassword } from './wallets/requests/changeSpendingPassword';
import { deleteWallet } from './wallets/requests/deleteWallet';
import { exportWalletAsJSON } from './wallets/requests/exportWalletAsJSON';
@@ -877,9 +876,9 @@ export default class AdaApi {
testReset = async (): Promise<void> => {
Logger.debug('AdaApi::testReset called');
try {
const response: Promise<void> = await resetWalletState(this.config);
const wallets: AdaWallets = await getWallets(this.config);
wallets.map(wallet => deleteWallet(this.config, { walletId: wallet.id }));
Logger.debug('AdaApi::testReset success');
return response;
} catch (error) {
Logger.error('AdaApi::testReset error', { error });
throw new GenericApiError();
@@ -895,7 +894,7 @@ export default class AdaApi {
}`;
Logger.debug(`${loggerText} called`);
try {
/* TODO: Uncomment once implemented
/* @API TODO: Uncomment once implemented
const nodeInfo: NodeInfoResponse = await getNodeInfo(
this.config,
@@ -1,15 +1,15 @@
// @flow
import { get } from 'lodash';
import AdaApi from '../api';
import { getNodeInfo } from '../nodes/requests/getNodeInfo';
// import { getNodeInfo } from '../nodes/requests/getNodeInfo';
import { getNodeSettings } from '../nodes/requests/getNodeSettings';
import { getLatestAppVersion } from '../nodes/requests/getLatestAppVersion';
import { GenericApiError } from '../common/errors';
import { Logger } from '../../utils/logging';
import type { NodeInfoQueryParams } from '../nodes/requests/getNodeInfo';
import type {
LatestAppVersionInfoResponse,
NodeInfoResponse,
// NodeInfoResponse,
GetNetworkStatusResponse,
NodeSettingsResponse,
GetNodeSettingsResponse,
@@ -33,6 +33,7 @@ export default (api: AdaApi) => {
): Promise<GetNetworkStatusResponse> => {
Logger.debug('AdaApi::getNetworkStatus (PATCHED) called');
try {
/* @API TODO: Uncomment once implemented
const nodeInfo: NodeInfoResponse = await getNodeInfo(
api.config,
queryInfoParams
@@ -46,7 +47,13 @@ export default (api: AdaApi) => {
subscriptionStatus,
syncProgress,
localBlockchainHeight,
} = nodeInfo;
} = nodeInfo; */

const blockchainHeight = { quantity: 100 };
const subscriptionStatus = 'subscribed';
const syncProgress = { quantity: 1 };
const localTimeInformation = { status: 'available' };
const localBlockchainHeight = { quantity: 100 };

// extract relevant data before sending to NetworkStatusStore
const response = {
@@ -57,8 +64,12 @@ export default (api: AdaApi) => {
localBlockchainHeight:
LOCAL_BLOCK_HEIGHT || localBlockchainHeight.quantity,
localTimeInformation: {
status: 'available',
difference: LOCAL_TIME_DIFFERENCE,
status: localTimeInformation.status,
difference: get(
localTimeInformation,
'localTimeDifference.quantity',
LOCAL_TIME_DIFFERENCE
),
},
};

This file was deleted.

0 comments on commit 85319ff

Please sign in to comment.
You can’t perform that action at this time.