add .domains(bytes32) test

This commit is contained in:
Ricardo Guilherme Schmidt 2018-05-25 13:40:53 -03:00 committed by Barry Gitarts
parent ba0d641868
commit dac59c0f55
1 changed files with 11 additions and 0 deletions

View File

@ -71,6 +71,10 @@ contract('ENSSubdomainRegistry', function () {
assert.equal(result.events.DomainPrice.returnValues.namehash, domains.free.namehash); assert.equal(result.events.DomainPrice.returnValues.namehash, domains.free.namehash);
result = await ENSSubdomainRegistry.methods.getPrice(domains.free.namehash).call() result = await ENSSubdomainRegistry.methods.getPrice(domains.free.namehash).call()
assert.equal(result, 0); assert.equal(result, 0);
result = await ENSSubdomainRegistry.methods.domains(domains.free.namehash).call()
assert(result.state, 1)
assert(result.price, domains.free.price)
}); });
it('should add paid domain', async () => { it('should add paid domain', async () => {
@ -80,6 +84,9 @@ contract('ENSSubdomainRegistry', function () {
assert.equal(result.events.DomainPrice.returnValues.namehash, domains.paid.namehash); assert.equal(result.events.DomainPrice.returnValues.namehash, domains.paid.namehash);
result = await ENSSubdomainRegistry.methods.getPrice(domains.paid.namehash).call() result = await ENSSubdomainRegistry.methods.getPrice(domains.paid.namehash).call()
assert.equal(result, initialPrice); assert.equal(result, initialPrice);
result = await ENSSubdomainRegistry.methods.domains(domains.free.namehash).call()
assert(result.state, 1)
assert(result.price, domains.paid.price)
}); });
it('should change paid domain price', async () => { it('should change paid domain price', async () => {
@ -89,6 +96,10 @@ contract('ENSSubdomainRegistry', function () {
assert.equal(result.events.DomainPrice.returnValues.namehash, domains.paid.namehash, "Wrong namehash at event"); assert.equal(result.events.DomainPrice.returnValues.namehash, domains.paid.namehash, "Wrong namehash at event");
result = await ENSSubdomainRegistry.methods.getPrice(domains.paid.namehash).call() result = await ENSSubdomainRegistry.methods.getPrice(domains.paid.namehash).call()
assert.equal(result, newPrice, "Wrong return value at getPrice"); assert.equal(result, newPrice, "Wrong return value at getPrice");
result = await ENSSubdomainRegistry.methods.domains(domains.paid.namehash).call()
assert(result.state, 1)
assert(result.price, newPrice)
}); });