Check for properties in returned authorities list
This commit is contained in:
parent
225aa2a6aa
commit
8e25f30611
@ -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 () => {
|
||||
|
@ -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]);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user