From 654ae88cc731fb12ad63e842cb739405cece4049 Mon Sep 17 00:00:00 2001 From: apanizo Date: Mon, 13 Aug 2018 11:57:24 +0200 Subject: [PATCH] WA-521 Asserting transactions following the updated model --- src/test/utils/historyServiceHelper.js | 30 ++++++-------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/test/utils/historyServiceHelper.js b/src/test/utils/historyServiceHelper.js index 8ad22983..1d6aebe9 100644 --- a/src/test/utils/historyServiceHelper.js +++ b/src/test/utils/historyServiceHelper.js @@ -2,7 +2,6 @@ import { List, Map } from 'immutable' import { type Confirmation } from '~/routes/safe/store/model/confirmation' import { type Transaction } from '~/routes/safe/store/model/transaction' -import { type Owner } from '~/routes/safe/store/model/owner' export const testSizeOfSafesWith = (transactions: Map>, size: number) => { expect(transactions).not.toBe(undefined) @@ -18,34 +17,19 @@ export const testSizeOfTransactions = (safeTxs: List | typeof undef } export const testTransactionFrom = ( - safeTxs: List | typeof undefined, pos: number, name: string, - nonce: number, value: number, threshold: number, destination: string, - data: string, creator: string, txHash: string, - firstOwner: Owner | typeof undefined, secondOwner: Owner | typeof undefined, + safeTxs: List | typeof undefined, pos: number, + name: string, nonce: number, value: number, destination: string, + data: string, isExecuted: boolean, confirmations: List, ) => { if (!safeTxs) { throw new Error() } const tx: Transaction | typeof undefined = safeTxs.get(pos) if (!tx) { throw new Error() } expect(tx.get('name')).toBe(name) - expect(tx.get('value')).toBe(value) - expect(tx.get('threshold')).toBe(threshold) - expect(tx.get('destination')).toBe(destination) - expect(tx.get('confirmations').count()).toBe(2) expect(tx.get('nonce')).toBe(nonce) + expect(tx.get('value')).toBe(value) + expect(tx.get('destination')).toBe(destination) expect(tx.get('data')).toBe(data) - - const confirmations: List = tx.get('confirmations') - const firstConfirmation: Confirmation | typeof undefined = confirmations.get(0) - if (!firstConfirmation) { throw new Error() } - expect(firstConfirmation.get('owner')).not.toBe(undefined) - expect(firstConfirmation.get('owner')).toEqual(firstOwner) - expect(firstConfirmation.get('status')).toBe(true) - expect(firstConfirmation.get('hash')).toBe(txHash) - - const secondConfirmation: Confirmation | typeof undefined = confirmations.get(1) - if (!secondConfirmation) { throw new Error() } - expect(secondConfirmation.get('owner')).not.toBe(undefined) - expect(secondConfirmation.get('owner')).toEqual(secondOwner) - expect(secondConfirmation.get('status')).toBe(false) + expect(tx.get('isExecuted')).toBe(isExecuted) + expect(tx.get('confirmations')).toBe(confirmations) }