Check for properties in returned authorities list
Some checks failed
Lint & Build / lint_and_build (20.x) (pull_request) Successful in 2m25s
Tests / sdk_tests (pull_request) Failing after 18m34s

This commit is contained in:
IshaVenikar 2024-08-02 15:40:27 +05:30
parent 225aa2a6aa
commit 8e25f30611
2 changed files with 23 additions and 6 deletions

View File

@ -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 () => {

View File

@ -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]);
});
});