mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import responses from "../fixtures/responses";
|
|
import rippled from "../fixtures/rippled";
|
|
import setupClient from "../setupClient";
|
|
import { addressTests, assertResultMatch } from "../testUtils";
|
|
|
|
describe("client.request", function () {
|
|
beforeEach(setupClient.setup);
|
|
afterEach(setupClient.teardown);
|
|
|
|
addressTests.forEach(function (test) {
|
|
describe(test.type, function () {
|
|
it("request account_objects", async function () {
|
|
this.mockRippled.addResponse(
|
|
"account_objects",
|
|
rippled.account_objects.normal
|
|
);
|
|
const result = await this.client.request({
|
|
command: "account_objects",
|
|
account: test.address,
|
|
});
|
|
|
|
assertResultMatch(
|
|
result.result,
|
|
responses.getAccountObjects,
|
|
"AccountObjectsResponse"
|
|
);
|
|
});
|
|
|
|
it("request account_objects - invalid options", async function () {
|
|
this.mockRippled.addResponse(
|
|
"account_objects",
|
|
rippled.account_objects.normal
|
|
);
|
|
const result = await this.client.request({
|
|
command: "account_objects",
|
|
account: test.address,
|
|
});
|
|
|
|
assertResultMatch(
|
|
result.result,
|
|
responses.getAccountObjects,
|
|
"AccountObjectsResponse"
|
|
);
|
|
});
|
|
});
|
|
});
|
|
});
|