fix sdk tests

This commit is contained in:
0xmuralik 2023-01-30 16:00:13 +05:30
parent 12dfc4362b
commit 37c577fb1d
2 changed files with 38 additions and 38 deletions

View File

@ -33,48 +33,48 @@ describe('Querying', () => {
expect(registry.chainID).toBe(chainId); expect(registry.chainID).toBe(chainId);
}); });
// test('Get status.', async () => { test('Get status.', async () => {
// const status = await registry.getStatus(); const status = await registry.getStatus();
// expect(status).toBeDefined(); expect(status).toBeDefined();
// expect(status.version).toBeDefined(); expect(status.version).toBeDefined();
// }); });
// test('List records.', async () => { test('List records.', async () => {
// const records = await registry.queryRecords({}, true); const records = await registry.queryRecords({}, true);
// expect(records.length).toBeGreaterThanOrEqual(1); expect(records.length).toBeGreaterThanOrEqual(1);
// }); });
// test('Query records by reference.', async () => { test('Query records by reference.', async () => {
// const { repo_registration_record_cid } = watcher.record; const { ref } = watcher.record.repo_reference;
// const records = await registry.queryRecords({ repo_registration_record_cid }, true); const records = await registry.queryRecords({ "repo_reference---ref---": ref}, true);
// expect(records.length).toBeGreaterThanOrEqual(1); expect(records.length).toBeGreaterThanOrEqual(1);
// const { attributes: { repo_registration_record_cid: record_repo_registration_record_cid } } = records[0]; const { attributes: { repo_reference: {ref: record_repo_registration_record_cid} } } = records[0];
// expect(repo_registration_record_cid).toBe(record_repo_registration_record_cid); expect(ref).toBe(record_repo_registration_record_cid);
// }); });
// test('Query records by attributes.', async () => { test('Query records by attributes.', async () => {
// const { version, name } = watcher.record; const { version, name } = watcher.record;
// const records = await registry.queryRecords({ version, name }, true); const records = await registry.queryRecords({ "version---": version, "name---": name }, true);
// expect(records.length).toBe(1); expect(records.length).toBe(1);
// [ watcher ] = records; [ watcher ] = records;
// const { attributes: { version: recordVersion, name: recordName } } = watcher; const { attributes: { version: recordVersion, name: recordName } } = watcher;
// expect(recordVersion).toBe(version); expect(recordVersion).toBe(version);
// expect(recordName).toBe(name); expect(recordName).toBe(name);
// }); });
// test('Query records by id.', async () => { test('Query records by id.', async () => {
// const records = await registry.getRecordsByIds([watcher.id]); const records = await registry.getRecordsByIds([watcher.id]);
// expect(records.length).toBe(1); expect(records.length).toBe(1);
// expect(records[0].id).toBe(watcher.id); expect(records[0].id).toBe(watcher.id);
// }); });
// test('Query records passing refs true.', async () => { test('Query records passing refs true.', async () => {
// const [record] = await registry.getRecordsByIds([watcher.id], true); const [record] = await registry.getRecordsByIds([watcher.id], true);
// expect(record.id).toBe(watcher.id); expect(record.id).toBe(watcher.id);
// // temp fix // temp fix
// expect(record.attributes.repo_registration_record_cid).toBeDefined(); expect(record.attributes.repo_reference.ref).toBeDefined();
// expect(record.attributes.repo_registration_record_cid).toHaveLength(46); expect(record.attributes.repo_reference.ref).toHaveLength(46);
// }); });
}); });

View File

@ -7,4 +7,4 @@ record:
ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
tls_cert_ref: tls_cert_ref:
ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
version: 1.0.23 version: 1.0.28