forked from cerc-io/laconic-sdk
nameservice passes local tests
This commit is contained in:
parent
606586818c
commit
fc61a32ea9
@ -62,39 +62,40 @@ const nameserviceExpiryTests = () => {
|
|||||||
setTimeout(done, 60 * 1000);
|
setTimeout(done, 60 * 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// test('Check record expiry time', async() => {
|
test('Check record expiry time', async() => {
|
||||||
// const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||||
// const updatedExpiryTime = new Date();
|
const updatedExpiryTime = new Date();
|
||||||
// expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime());
|
expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime());
|
||||||
// recordExpiryTime = updatedExpiryTime;
|
recordExpiryTime = updatedExpiryTime;
|
||||||
// })
|
})
|
||||||
|
|
||||||
// test('Check authority expiry time', async() => {
|
test('Check authority expiry time', async() => {
|
||||||
// const [authority] = await registry.lookupAuthorities([authorityName]);
|
const [authority] = await registry.lookupAuthorities([authorityName]);
|
||||||
// const updatedExpiryTime = new Date();
|
const updatedExpiryTime = new Date();
|
||||||
// expect(updatedExpiryTime.getTime()).toBeGreaterThan(authorityExpiryTime.getTime());
|
expect(updatedExpiryTime.getTime()).toBeGreaterThan(authorityExpiryTime.getTime());
|
||||||
// authorityExpiryTime = updatedExpiryTime;
|
authorityExpiryTime = updatedExpiryTime;
|
||||||
// })
|
})
|
||||||
|
|
||||||
// test('Check bond balance', async () => {
|
test('Check bond balance', async () => {
|
||||||
// const [bond] = await registry.getBondsByIds([bondId]);
|
const [bond] = await registry.getBondsByIds([bondId]);
|
||||||
// expect(bond).toBeDefined();
|
console.log(bond)
|
||||||
// expect(bond.balance).toBe('2000000');
|
expect(bond).toBeDefined();
|
||||||
// })
|
expect(bond.balance).toHaveLength(0);
|
||||||
|
})
|
||||||
|
|
||||||
// test('Wait for expiry duration', (done) => {
|
test('Wait for expiry duration', (done) => {
|
||||||
// setTimeout(done, 60 * 1000);
|
setTimeout(done, 60 * 1000);
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
// test('Check record deleted without bond balance', async() => {
|
test('Check record deleted without bond balance', async() => {
|
||||||
// const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
|
||||||
// expect(records).toHaveLength(0);
|
expect(records).toHaveLength(0);
|
||||||
// })
|
})
|
||||||
//
|
|
||||||
// test('Check authority expired without bond balance', async() => {
|
test('Check authority expired without bond balance', async() => {
|
||||||
// const [authority] = await registry.lookupAuthorities([authorityName]);
|
const [authority] = await registry.lookupAuthorities([authorityName]);
|
||||||
// expect(authority.status).toBe('expired');
|
expect(authority.status).toBe('expired');
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
||||||
@ -104,7 +105,7 @@ if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
|||||||
/**
|
/**
|
||||||
Running these tests requires timers to be set. In laconicd repo run:
|
Running these tests requires timers to be set. In laconicd repo run:
|
||||||
|
|
||||||
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
TEST_REGISTRY_EXPIRY=true ./init.sh
|
||||||
|
|
||||||
|
|
||||||
Run tests:
|
Run tests:
|
||||||
|
@ -4,4 +4,4 @@ record:
|
|||||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||||
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||||
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||||
version: 1.0.17
|
version: 1.0.23
|
||||||
|
Loading…
Reference in New Issue
Block a user