Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
add get_scheduled_transactions test
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Apr 12, 2019
1 parent dcaa667 commit af7afd6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/tests/eosjs-jsonrpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,29 @@ describe('JSON RPC', () => {
expect(fetch).toBeCalledWith(endpoint + expPath, expParams);
});

it('calls get_scheduled_transactions', async() => {
const expPath = '/v1/chain/get_scheduled_transactions';
const json = true;
const lowerBound = '';
const limit = 50;
const expReturn = { data: '12345' };
const expParams = {
body: JSON.stringify({
json,
lower_bound: lowerBound,
limit,
}),
method: 'POST',
};

fetchMock.once(JSON.stringify(expReturn));

const response = await jsonRpc.get_scheduled_transactions();

expect(response).toEqual(expReturn);
expect(fetch).toBeCalledWith(endpoint + expPath, expParams);
});

it('calls get_table_rows with all params', async () => {
const expPath = '/v1/chain/get_table_rows';
const json = false;
Expand Down

0 comments on commit af7afd6

Please sign in to comment.