Skip to content

Commit 3e92eb2

Browse files
Enable/disable account (#61)
* Initial implementation * Minor bugfix to prevent saga cancellation * Remove redundant portal backend APIs * Fix financial positions page object * Further parametrise voodoo timeout. Increase voodoo timeout. Remove redundant import. * Test for account enable/disable * 2.5.0 * Versions
1 parent f1580c8 commit 3e92eb2

File tree

18 files changed

+382
-301
lines changed

18 files changed

+382
-301
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
2-
appVersion: "v2.4.1"
2+
appVersion: "v2.5.0"
33
description: Mojaloop Finance Portal UI v2
44
name: finance-portal-v2-ui
5-
version: 2.4.1
5+
version: 2.5.0

helm/finance-portal-v2-ui/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66

77
image:
88
repository: ghcr.io/mojaloop/finance-portal-v2-ui
9-
tag: v2.4.1
9+
tag: v2.5.0
1010
pullPolicy: IfNotPresent
1111

1212
imagePullCredentials:

integration_test/tests/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ export const config = {
3333
password: users[1].password,
3434
},
3535
},
36+
voodooTimeoutMs: 30000,
3637
};

integration_test/tests/src/page-objects/pages/FinancialPositionsPage.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type FinancialPositionsRow = {
1313
ndc: Selector,
1414
ndcUsed: Selector,
1515
updateButton: Selector,
16+
enableDisableButton: Selector,
1617
}
1718

1819
const finPosUpdateConfirmRoot = ReactSelector('FinancialPositionUpdateConfirm Modal');
@@ -61,11 +62,13 @@ export const FinancialPositionsPage = {
6162
.from({ length })
6263
.map((_, i) => ({
6364
dfsp: rows.nth(i).findReact('ItemCell').nth(0),
64-
balance: rows.nth(i).findReact('ItemCell').nth(1),
65-
position: rows.nth(i).findReact('ItemCell').nth(1),
66-
ndc: rows.nth(i).findReact('ItemCell').nth(1),
67-
ndcUsed: rows.nth(i).findReact('ItemCell').nth(1),
68-
updateButton: rows.nth(i).findReact('Button'),
65+
currency: rows.nth(i).findReact('ItemCell').nth(1),
66+
balance: rows.nth(i).findReact('ItemCell').nth(2),
67+
position: rows.nth(i).findReact('ItemCell').nth(3),
68+
ndc: rows.nth(i).findReact('ItemCell').nth(4),
69+
ndcUsed: rows.nth(i).findReact('ItemCell').nth(5),
70+
updateButton: rows.nth(i).findReact('ItemCell').nth(6).findReact('Button'),
71+
enableDisableButton: rows.nth(i).findReact('ItemCell').nth(7).findReact('Button'),
6972
}));
7073
},
7174
};

integration_test/tests/src/tests/DFSPFinancialPositions.test.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { SideMenu } from '../page-objects/components/SideMenu';
66
import { LoginPage } from '../page-objects/pages/LoginPage';
77
import {
88
FinancialPositionsPage,
9-
FinancialPositionsRow,
109
FinancialPositionUpdateConfirmModal,
1110
PositionUpdateAction,
1211
FinancialPositionUpdateModal
@@ -16,7 +15,7 @@ import { VoodooClient, protocol } from 'mojaloop-voodoo-client';
1615
fixture`DFSPFinancialPositions`
1716
.page`${config.financePortalEndpoint}`
1817
.before(async (ctx) => {
19-
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: 15000 });
18+
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: config.voodooTimeoutMs });
2019
await cli.connected();
2120

2221
const hubAccounts: protocol.HubAccount[] = [
@@ -82,6 +81,29 @@ test.meta({
8281
}
8382
)
8483

84+
test(
85+
'Enable/disable account works correctly',
86+
async (t) => {
87+
const dfspRows = await FinancialPositionsPage.getDfspRowMap();
88+
const testRow = dfspRows.get(t.fixtureCtx.participants[0].name);
89+
assert(testRow, 'Expected to find the participant we created in the list of financial positions');
90+
91+
await t
92+
.expect(testRow.enableDisableButton.innerText)
93+
.eql('Disable', 'Expected new test participant to have enabled account');
94+
await t.click(testRow.enableDisableButton);
95+
96+
await t
97+
.expect(testRow.enableDisableButton.innerText)
98+
.eql('Enable', 'Expected test participant to have disabled account after disable selected');
99+
await t.click(testRow.enableDisableButton);
100+
101+
await t
102+
.expect(testRow.enableDisableButton.innerText)
103+
.eql('Disable', 'Expected test participant to have disabled account after enable selected');
104+
}
105+
)
106+
85107
test.skip.meta({
86108
ID: 'MMD-T26',
87109
STORY: 'MMD-376',

integration_test/tests/src/tests/FindTransfersPage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { v4 as uuidv4 } from 'uuid';
99
fixture `Find Transfers Feature`
1010
.page`${config.financePortalEndpoint}`
1111
.before(async (ctx) => {
12-
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: 15000 });
12+
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: config.voodooTimeoutMs });
1313
await cli.connected();
1414

1515
const hubAccounts: protocol.HubAccount[] = [

integration_test/tests/src/tests/SettlementWindowsPage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fixture `Settlement windows page`
2929
// isn't handled correctly, causing the root page (i.e. login) to load again.
3030
.page `${config.financePortalEndpoint}`
3131
.before(async (ctx) => {
32-
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: 15000 });
32+
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: config.voodooTimeoutMs });
3333
await cli.connected();
3434

3535
const hubAccounts: protocol.HubAccount[] = [

integration_test/tests/src/tests/SettlementsPage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { v4 as uuidv4 } from 'uuid';
99
fixture `Settlements Feature`
1010
.page`${config.financePortalEndpoint}`
1111
.before(async (ctx) => {
12-
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: 15000 });
12+
const cli = new VoodooClient('ws://localhost:3030/voodoo', { defaultTimeout: config.voodooTimeoutMs });
1313
await cli.connected();
1414

1515
const hubAccounts: protocol.HubAccount[] = [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "finance-portal-v2-ui",
3-
"version": "2.4.1",
3+
"version": "2.5.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

src/App/FinancialPositions/actions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
CLOSE_FINANCIAL_POSITION_UPDATE_CONFIRM_MODAL,
1515
SUBMIT_FINANCIAL_POSITION_UPDATE_CONFIRM_MODAL,
1616
UPDATE_FINANCIAL_POSITION_NDC_AFTER_CONFIRM_MODAL,
17+
TOGGLE_CURRENCY_ACTIVE,
1718
} from './types';
1819

1920
/** Actions for "DFSP Financial Positions" */
@@ -37,3 +38,6 @@ export const submitFinancialPositionUpdateConfirmModal = createAction(SUBMIT_FIN
3738
export const updateFinancialPositionNDCAfterConfirmModal = createAction(
3839
UPDATE_FINANCIAL_POSITION_NDC_AFTER_CONFIRM_MODAL,
3940
);
41+
42+
/** Actions for "DFSP Financial Positions" > "Enable"/"Disable" button */
43+
export const toggleCurrencyActive = createAction<FinancialPosition>(TOGGLE_CURRENCY_ACTIVE);

0 commit comments

Comments
 (0)