authority tests

This commit is contained in:
0xmuralik 2023-04-03 16:40:32 +05:30
parent 9a45237b2d
commit 679313d960

View File

@ -1,7 +1,7 @@
import {cliTest,createBond} from './helper'; import {cliTest,createBond} from './helper';
const args= "authority " const args= "authority "
const name="laconic" const name=`laconic-${Date.now()}`
var bondId: string; var bondId: string;
@ -15,16 +15,27 @@ describe("test authority",() => {
it("reserve authority",async ()=>{ it("reserve authority",async ()=>{
const resp=cliTest(args+"reserve "+name); const resp=cliTest(args+"reserve "+name);
expect(resp).toBeDefined; expect(resp).toBeDefined();
expect(resp.success).toBeTruthy();
}); });
it("lookup authority information.",async ()=>{ it("lookup authority information.",async ()=>{
const resp=cliTest(args+"whois "+ name); const resp=cliTest(args+"whois "+ name);
expect(resp).toBeDefined; expect(resp).toBeDefined();
expect(resp.length).toEqual(1);
expect(resp[0].status).toEqual("active")
expect(resp[0].bondId).toEqual("")
}); });
it("set authority bond",async ()=>{ it("set authority bond",async ()=>{
const resp=cliTest(args+"bond set "+name+" "+bondId); const bondSet=cliTest(args+"bond set "+name+" "+bondId);
expect(resp).toBeDefined; expect(bondSet).toBeDefined();
expect(bondSet.success).toBeTruthy();
const resp=cliTest(args+"whois "+ name);
expect(resp).toBeDefined();
expect(resp.length).toEqual(1);
expect(resp[0].status).toEqual("active")
expect(resp[0].bondId).toEqual(bondId)
}); });
}); });