it("should retrieve account informations WITHOUT arguments", () => { expect(client.account_info(WALLET_ADDRESS)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"'); });
it("should retrieve account informations WITH representative", () => { expect(client.account_info(WALLET_ADDRESS, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"representative"') .notify(done); });
it("should find a workflow by its custom id", async () => { // Arrange const workflowClass = class TestWorkflow extends AbstractWorkflow {}; const customId = "45745c60"; const fakeWorkflow = {}; findWorkflowStub.resolves(fakeWorkflow); // Act const builder = new Builder(workflowClass); const result = builder.whereId(customId).find(); // Assert await expect(result) .to.eventually.be.fulfilled() .and.to.equal(fakeWorkflow); expect(findWorkflowStub).to.have.been.calledOnceWithExactly( workflowClass, customId, ); });
.to.eventually.be.fulfilled() .and.to.be.an("array"); await expect(Promise.all(content)) .to.eventually.be.fulfilled() .and.to.eql(["Result Workflow", "Result Task"]); expect(jobWorkflow.handle).to.have.been.calledOnceWithExactly(); expect(jobTask._promiseHandle).to.have.been.calledOnceWithExactly(); }); .to.eventually.be.fulfilled() .and.to.be.an("array"); await expect(Promise.all(content)) .to.eventually.be.fulfilled() .and.to.eql(["Result Workflow", "Result Task"]); expect(startTaskFake).to.have.been.calledOnceWithExactly(jobTask); expect(startWorkflowFake).to.have.been.calledOnceWithExactly(jobWorkflow); }); });
.to.eventually.be.fulfilled() .and.to.be.an("array"); await expect(Promise.all(content)) .to.eventually.be.fulfilled() .and.to.eql(["Result Workflow", "Result Task"]); expect(processor.process).to.have.been.calledOnceWithExactly(jobs, true); }); .to.eventually.be.fulfilled() .and.to.be.an("array"); await expect(Promise.all(content)) .to.eventually.be.fulfilled() .and.to.eql(["Result Workflow", "Result Task"]); expect(processor.process).to.have.been.calledOnceWithExactly(jobs, false); }); });
it("should retrieve account informations WITH all arguments to true", () => { expect(client.account_info(WALLET_ADDRESS, true, true, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"representative"') .and.to.eventually.contain('"weight"') .and.to.eventually.contain('"pending"') .notify(done); });
it("should retrieve account informations WITH voting weight", () => { expect(client.account_info(WALLET_ADDRESS, false, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"weight"') .notify(done); });
it("should retrieve account informations WITH pending balance", () => { expect(client.account_info(WALLET_ADDRESS, false, false, true)) .to.eventually.contain('"frontier"') .and.to.eventually.contain('"open_block"') .and.to.eventually.contain('"representative_block"') .and.to.eventually.contain('"balance"') .and.to.eventually.contain('"modified_timestamp"') .and.to.eventually.contain('"block_count"') .and.to.eventually.contain('"pending"') .notify(done); });