diff --git a/src/nameservice-expiry.test.ts b/src/nameservice-expiry.test.ts index a8627e7..184c13a 100644 --- a/src/nameservice-expiry.test.ts +++ b/src/nameservice-expiry.test.ts @@ -61,6 +61,9 @@ const nameserviceExpiryTests = () => { test('Wait for expiry duration', (done) => { setTimeout(done, 60 * 1000); + + // Wait some more time for block to be executed + setTimeout(done, 3 * 1000); }); test('Check record expiry time', async () => { @@ -85,6 +88,9 @@ const nameserviceExpiryTests = () => { test('Wait for expiry duration', (done) => { setTimeout(done, 60 * 1000); + + // Wait some more time for block to be executed + setTimeout(done, 3 * 1000); }); test('Check record deleted without bond balance', async () => { diff --git a/src/naming.test.ts b/src/naming.test.ts index 2edf69f..7b1cd79 100644 --- a/src/naming.test.ts +++ b/src/naming.test.ts @@ -169,17 +169,28 @@ const namingTests = () => { }); test('List authorities.', async () => { - const authorities = await registry.getAuthorities(); - + const authorities = await registry.getAuthorities(undefined, true); reservedAuthorities.sort((a, b) => a.name.localeCompare(b.name)); + const expectedEntryKeys = [ + 'ownerAddress', + 'ownerPublicKey', + 'height', + 'status', + 'bondId', + 'expiryTime', + 'auction' + ]; expect(authorities.length).toEqual(4); - authorities.forEach((authority: any, index: number) => { + expectedEntryKeys.forEach(key => { authorities.forEach((authority: any) => { - expect(authority).toHaveProperty('name'); - expect(authority.entry).toHaveProperty('ownerAddress'); - expect(authority.entry).toHaveProperty('status'); + expect(authority.entry).toHaveProperty(key); }); + }); + authorities.forEach((authority: any, index: number) => { + expect(authority).toHaveProperty('name'); + expect(authority.entry).toHaveProperty('ownerAddress'); + expect(authority.entry).toHaveProperty('status'); expect(authority).toMatchObject(reservedAuthorities[index]); }); });