Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit 9ef90df

Browse files
committed
Removed magic numbers from tests, added constants
1 parent 6c072f8 commit 9ef90df

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/contracts/test/TestListingsRegistry.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,17 @@ contract('ListingsRegistry', accounts => {
2828
assert.equal(listingCount, 5)
2929
})
3030

31-
xit('should be able to remove a listing', async function() {
32-
})
33-
3431
it('should be able to create a listing', async function() {
35-
await instance.create(ipfsHash, 2, 5, {from: accounts[0]})
32+
const initPrice = 2
33+
const initUnitsAvailable = 5
34+
await instance.create(ipfsHash, initPrice, initUnitsAvailable, {from: accounts[0]})
3635
let listingCount = await instance.listingsLength()
3736
assert.equal(listingCount, initialListingsLength + 1, 'listings count has incremented')
3837
let [index, lister, hash, price, unitsAvailable] = await instance.getListing(initialListingsLength)
3938
assert.equal(lister, accounts[0], 'lister is correct')
4039
assert.equal(hash, ipfsHash, 'ipfsHash is correct')
41-
assert.equal(price, 2, 'price is correct')
42-
assert.equal(unitsAvailable, 5, 'unitsAvailable is correct')
40+
assert.equal(price, initPrice, 'price is correct')
41+
assert.equal(unitsAvailable, initUnitsAvailable, 'unitsAvailable is correct')
4342
})
4443

4544
})

0 commit comments

Comments
 (0)