Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
Remove listOwners test duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Stefanski committed Dec 9, 2017
1 parent 5bbc32b commit 748887e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
13 changes: 7 additions & 6 deletions test/MultiSig/multisig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,19 @@ contract('MultiSig', accounts => {
ctx.multisig = await MultiSigContract.new(owners);
});

describe('#ctor', () => {
it('should set owners', async () => {
assert.deepEqual(await ctx.multisig.listOwners(), owners);
});
});

describe('#listOwners', () => testListOwners(ctx));
describe('#fallback', () => testFallback(ctx));
describe('#execute', () => testExecute(ctx));
});
});
});

export function testListOwners(ctx: MultiSigTestContext<MultiSig>) {
it('should list owners', async () => {
assert.deepEqual(await ctx.multisig.listOwners(), ctx.owners);
});
}

export function testFallback(ctx: MultiSigTestContext<MultiSig>) {
const defaultAccount = ctx.accounts[9];

Expand Down
6 changes: 0 additions & 6 deletions test/MultiSig/recoverablemultisig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ contract('RecoverableMultiSigContract', accounts => {
);
});

describe('#ctor', () => {
it('should set owners', async () => {
assert.deepEqual(await ctx.multisig.listOwners(), owners);
});
});

describe('#startRecovery', () => testStartRecovery(ctx));
describe('#cancelRecovery', () => testCancelRecovery(ctx));
describe('#confirmRecovery', () => testConfirmRecovery(ctx));
Expand Down
6 changes: 0 additions & 6 deletions test/MultiSig/transferablemultisig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ contract('TransferableMultiSigContract', accounts => {
ctx.multisig = await TransferableMultiSigContract.new(owners);
});

describe('#ctor', () => {
it('should set owners', async () => {
assert.deepEqual(await ctx.multisig.listOwners(), owners);
});
});

describe('#transferOwnership', () => testTransferOwnership(ctx));
});
});
Expand Down
15 changes: 6 additions & 9 deletions test/tipswallet.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { assert } from 'chai';

import * as Web3 from 'web3';

import { SignHashArtifacts, TipsWallet } from 'signhash';
import { ContractContextDefinition } from 'truffle';

import { assertThrowsInvalidOpcode } from './helpers';
import { MultiSigTestContext } from './MultiSig/context';
import { testExecute, testFallback } from './MultiSig/multisig.test';
import {
testExecute,
testFallback,
testListOwners
} from './MultiSig/multisig.test';
import {
testCancelRecovery,
testConfirmRecovery,
Expand Down Expand Up @@ -45,12 +47,7 @@ contract('TipsWallet', accounts => {
);
});

describe('#ctor', () => {
it('should set owners', async () => {
assert.deepEqual(await ctx.multisig.listOwners(), owners);
});
});

describe('#listOwners', () => testListOwners(ctx));
describe('#fallback', () => testFallback(ctx));
describe('#execute', () => testExecute(ctx));
describe('#transferOwnership', () => testTransferOwnership(ctx));
Expand Down

0 comments on commit 748887e

Please sign in to comment.