delete-me/test/name.test.ts

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-03-26 20:12:52 +00:00
import {cliTest,createBond,createRecord} from './helper';
2023-03-24 11:32:38 +00:00
2023-03-27 06:49:33 +00:00
const args= "name ";
const name="laconic-name";
const crn=`crn://${name}/app/test`;
2023-03-24 11:32:38 +00:00
var recordId: string;
describe("test names",() => {
beforeAll(async () => {
2023-03-26 20:12:52 +00:00
// get bond id
const bondId = createBond("aphoton","10000000")
2023-03-24 11:32:38 +00:00
// get record id
2023-03-26 20:12:52 +00:00
recordId=createRecord("./test/examples/watcher.yml",bondId)
2023-03-27 06:49:33 +00:00
// reserve authority
cliTest("authority reserve "+name);
// set authority bond
cliTest(args+"bond set "+name+" "+bondId);
2023-03-24 11:32:38 +00:00
});
it("set name",async ()=>{
2023-03-27 06:49:33 +00:00
const resp=cliTest(args+"set "+crn+" "+recordId);
2023-03-24 11:32:38 +00:00
expect(resp).toBeDefined;
});
it("lookup name",async ()=>{
2023-03-27 06:49:33 +00:00
const resp=cliTest(args+"lookup "+ crn);
2023-03-24 11:32:38 +00:00
expect(resp).toBeDefined;
});
it("resolve name",async ()=>{
2023-03-27 06:49:33 +00:00
const resp=cliTest(args+"resolve "+crn);
2023-03-24 11:32:38 +00:00
expect(resp).toBeDefined;
});
it("delelte name",async ()=>{
2023-03-27 06:49:33 +00:00
const resp=cliTest(args+"delete "+crn);
2023-03-24 11:32:38 +00:00
expect(resp).toBeDefined;
});
});