remaining record types support #27

Merged
0xmuralik merged 7 commits from murali/record-types into main 2023-03-06 21:17:43 +00:00
2 changed files with 38 additions and 38 deletions
Showing only changes of commit 37c577fb1d - Show all commits

View File

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

View File

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