forked from cerc-io/laconic-sdk
fix sdk tests
This commit is contained in:
parent
12dfc4362b
commit
37c577fb1d
@ -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);
|
||||
});
|
||||
});
|
||||
|
@ -7,4 +7,4 @@ record:
|
||||
ref: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cert_ref:
|
||||
ref: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.0.23
|
||||
version: 1.0.28
|
||||
|
Loading…
Reference in New Issue
Block a user