aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/test
diff options
context:
space:
mode:
Diffstat (limited to 'packages/connect/test')
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json2
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts2
-rw-r--r--packages/connect/test/http_client_test.ts31
3 files changed, 20 insertions, 15 deletions
diff --git a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json
index 1ea3dcc0e..47ce42412 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json
+++ b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json
@@ -3,7 +3,7 @@
"page": 1,
"perPage": 10,
"records": [
- "0x6eC92694ea172ebC430C30fa31De87620967A082",
+ "0x6ec92694ea172ebc430c30fa31de87620967a082",
"0x9e56625509c2f60af937f23b7b532600390e8c8b",
"0xa2b31dacf30a9c50ca473337c01d8a201ae33e32"
]
diff --git a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
index a95bd25dd..e17ffe7a8 100644
--- a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
+++ b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
@@ -5,7 +5,7 @@ export const feeRecipientsResponse: FeeRecipientsResponse = {
page: 1,
perPage: 10,
records: [
- '0x6eC92694ea172ebC430C30fa31De87620967A082',
+ '0x6ec92694ea172ebc430c30fa31de87620967a082',
'0x9e56625509c2f60af937f23b7b532600390e8c8b',
'0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
],
diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts
index cdff00a61..1c40cb10f 100644
--- a/packages/connect/test/http_client_test.ts
+++ b/packages/connect/test/http_client_test.ts
@@ -43,8 +43,7 @@ describe('HttpClient', () => {
describe('#getAssetPairsAsync', () => {
const url = `${relayUrl}/asset_pairs`;
it('gets assetData pairs with default options when none are provided', async () => {
- const urlWithQuery = `${url}?page=1&perPage=100`;
- fetchMock.get(urlWithQuery, assetDataPairsResponseJSON);
+ fetchMock.get(url, assetDataPairsResponseJSON);
const assetDataPairs = await relayerClient.getAssetPairsAsync();
expect(assetDataPairs).to.be.deep.equal(assetDataPairsResponse);
});
@@ -54,8 +53,9 @@ describe('HttpClient', () => {
assetDataA: assetData,
page: 3,
perPage: 50,
+ networkdId: 42,
};
- const urlWithQuery = `${url}?assetDataA=${assetData}&page=3&perPage=50`;
+ const urlWithQuery = `${url}?assetDataA=${assetData}&networkdId=42&page=3&perPage=50`;
fetchMock.get(urlWithQuery, assetDataPairsResponseJSON);
const assetDataPairs = await relayerClient.getAssetPairsAsync(assetPairsRequestOpts);
expect(assetDataPairs).to.be.deep.equal(assetDataPairsResponse);
@@ -68,8 +68,7 @@ describe('HttpClient', () => {
describe('#getOrdersAsync', () => {
const url = `${relayUrl}/orders`;
it('gets orders with default options when none are provided', async () => {
- const urlWithQuery = `${url}?page=1&perPage=100`;
- fetchMock.get(urlWithQuery, ordersResponseJSON);
+ fetchMock.get(url, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync();
expect(orders).to.be.deep.equal(ordersResponse);
});
@@ -79,8 +78,9 @@ describe('HttpClient', () => {
assetDataAddress,
page: 3,
perPage: 50,
+ networkdId: 42,
};
- const urlWithQuery = `${url}?assetDataAddress=${assetDataAddress}&page=3&perPage=50`;
+ const urlWithQuery = `${url}?assetDataAddress=${assetDataAddress}&networkdId=42&page=3&perPage=50`;
fetchMock.get(urlWithQuery, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync(ordersRequest);
expect(orders).to.be.deep.equal(ordersResponse);
@@ -112,7 +112,7 @@ describe('HttpClient', () => {
it('gets orderbook with default page options when none are provided', async () => {
const urlWithQuery = `${url}?baseAssetData=${
request.baseAssetData
- }&page=1&perPage=100&quoteAssetData=${request.quoteAssetData}`;
+ }&quoteAssetData=${request.quoteAssetData}`;
fetchMock.get(urlWithQuery, orderbookJSON);
const orderbook = await relayerClient.getOrderbookAsync(request);
expect(orderbook).to.be.deep.equal(orderbookResponse);
@@ -120,11 +120,12 @@ describe('HttpClient', () => {
it('gets orderbook with specified page options', async () => {
const urlWithQuery = `${url}?baseAssetData=${
request.baseAssetData
- }&page=3&perPage=50&quoteAssetData=${request.quoteAssetData}`;
+ }&networkId=42&page=3&perPage=50&quoteAssetData=${request.quoteAssetData}`;
fetchMock.get(urlWithQuery, orderbookJSON);
const pagedRequestOptions = {
page: 3,
perPage: 50,
+ networkId: 42,
};
const orderbook = await relayerClient.getOrderbookAsync(request, pagedRequestOptions);
expect(orderbook).to.be.deep.equal(orderbookResponse);
@@ -146,7 +147,7 @@ describe('HttpClient', () => {
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
};
const url = `${relayUrl}/order_config`;
- it('gets fees', async () => {
+ it('gets order config', async () => {
fetchMock.post(url, orderConfigResponseJSON);
const fees = await relayerClient.getOrderConfigAsync(request);
expect(fees).to.be.deep.equal(orderConfigResponse);
@@ -168,17 +169,18 @@ describe('HttpClient', () => {
});
describe('#getFeeRecipientsAsync', () => {
const url = `${relayUrl}/fee_recipients`;
- it('gets orderbook with default page options when none are provided', async () => {
+ it('gets fee recipients with default page options when none are provided', async () => {
fetchMock.get(url, feeRecipientsResponseJSON);
const feeRecipients = await relayerClient.getFeeRecipientsAsync();
expect(feeRecipients).to.be.deep.equal(feeRecipientsResponse);
});
- it('gets orderbook with specified page options', async () => {
- const urlWithQuery = `${url}?&page=3&perPage=50`;
- fetchMock.get(url, feeRecipientsResponseJSON);
+ it('gets fee reciipient with specified page options', async () => {
+ const urlWithQuery = `${url}?networkId=42&page=3&perPage=50`;
+ fetchMock.get(urlWithQuery, feeRecipientsResponseJSON);
const pagedRequestOptions = {
page: 3,
perPage: 50,
+ networkId: 42,
};
const feeRecipients = await relayerClient.getFeeRecipientsAsync(pagedRequestOptions);
expect(feeRecipients).to.be.deep.equal(feeRecipientsResponse);
@@ -189,3 +191,6 @@ describe('HttpClient', () => {
});
});
});
+
+// https://example.com/fee_recipients?networkId=42&page=3&perPage=50
+// https://example.com/fee_recipients?networkId=42&page=3&perPage=50 \ No newline at end of file