From 7ca113b59bc5a755f878825353e2d66b2b51324b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 29 Jun 2017 13:11:50 -0700 Subject: Add a test for a ProxyWrapper --- test/proxy_wrapper_test.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/proxy_wrapper_test.ts (limited to 'test/proxy_wrapper_test.ts') diff --git a/test/proxy_wrapper_test.ts b/test/proxy_wrapper_test.ts new file mode 100644 index 000000000..98c5d1c31 --- /dev/null +++ b/test/proxy_wrapper_test.ts @@ -0,0 +1,35 @@ +import * as _ from 'lodash'; +import 'mocha'; +import * as chai from 'chai'; +import {chaiSetup} from './utils/chai_setup'; +import {web3Factory} from './utils/web3_factory'; +import {ZeroEx} from '../src'; +import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; +import {SchemaValidator} from '../src/utils/schema_validator'; +import {tokenSchema} from '../src/schemas/token_schema'; +import {ProxyWrapper} from '../src/contract_wrappers/proxy_wrapper'; + +chaiSetup.configure(); +const expect = chai.expect; +const blockchainLifecycle = new BlockchainLifecycle(); + +describe('ProxyWrapper', () => { + let zeroEx: ZeroEx; + before(async () => { + const web3 = web3Factory.create(); + zeroEx = new ZeroEx(web3.currentProvider); + }); + beforeEach(async () => { + await blockchainLifecycle.startAsync(); + }); + afterEach(async () => { + await blockchainLifecycle.revertAsync(); + }); + describe('#isAuthorizedAsync', () => { + it('should return false if the address is not authorized', async () => { + const proxyWrapper = (zeroEx as any)._proxyWrapper as ProxyWrapper; + const isAuthorized = await proxyWrapper.isAuthorizedAsync(ZeroEx.NULL_ADDRESS); + expect(isAuthorized).to.be.false(); + }); + }); +}); -- cgit v1.2.3 From 1321ea5beb530ca301ff4c7408ada66c44759b12 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 29 Jun 2017 13:15:20 -0700 Subject: Remove unused code from test/proxy_wrapper_test.ts --- test/proxy_wrapper_test.ts | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'test/proxy_wrapper_test.ts') diff --git a/test/proxy_wrapper_test.ts b/test/proxy_wrapper_test.ts index 98c5d1c31..29b5776c6 100644 --- a/test/proxy_wrapper_test.ts +++ b/test/proxy_wrapper_test.ts @@ -1,17 +1,11 @@ -import * as _ from 'lodash'; -import 'mocha'; import * as chai from 'chai'; import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; import {ZeroEx} from '../src'; -import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; -import {SchemaValidator} from '../src/utils/schema_validator'; -import {tokenSchema} from '../src/schemas/token_schema'; import {ProxyWrapper} from '../src/contract_wrappers/proxy_wrapper'; chaiSetup.configure(); const expect = chai.expect; -const blockchainLifecycle = new BlockchainLifecycle(); describe('ProxyWrapper', () => { let zeroEx: ZeroEx; @@ -19,12 +13,6 @@ describe('ProxyWrapper', () => { const web3 = web3Factory.create(); zeroEx = new ZeroEx(web3.currentProvider); }); - beforeEach(async () => { - await blockchainLifecycle.startAsync(); - }); - afterEach(async () => { - await blockchainLifecycle.revertAsync(); - }); describe('#isAuthorizedAsync', () => { it('should return false if the address is not authorized', async () => { const proxyWrapper = (zeroEx as any)._proxyWrapper as ProxyWrapper; -- cgit v1.2.3