From 679313d9605ecb167c05632247b9bfee8035fdb4 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Mon, 3 Apr 2023 16:40:32 +0530 Subject: [PATCH] authority tests --- test/authority.test.ts | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/authority.test.ts b/test/authority.test.ts index 42c5935..14682de 100644 --- a/test/authority.test.ts +++ b/test/authority.test.ts @@ -1,7 +1,7 @@ import {cliTest,createBond} from './helper'; const args= "authority " -const name="laconic" +const name=`laconic-${Date.now()}` var bondId: string; @@ -15,16 +15,27 @@ describe("test authority",() => { it("reserve authority",async ()=>{ const resp=cliTest(args+"reserve "+name); - expect(resp).toBeDefined; + expect(resp).toBeDefined(); + expect(resp.success).toBeTruthy(); }); it("lookup authority information.",async ()=>{ 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 ()=>{ - const resp=cliTest(args+"bond set "+name+" "+bondId); - expect(resp).toBeDefined; + const bondSet=cliTest(args+"bond set "+name+" "+bondId); + 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) }); }); \ No newline at end of file