Auction nameservice tests #28

Merged
ABastionOfSanity merged 17 commits from auction_nameservice_tests into main 2023-02-10 19:44:23 +00:00
2 changed files with 33 additions and 32 deletions
Showing only changes of commit fc61a32ea9 - Show all commits

View File

@ -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:

View File

@ -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