Skip to content

Instantly share code, notes, and snippets.

@leongaban
Last active September 18, 2018 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leongaban/aebdd8b570658be0ddf3b396c1eaaf4a to your computer and use it in GitHub Desktop.
Save leongaban/aebdd8b570658be0ddf3b396c1eaaf4a to your computer and use it in GitHub Desktop.
poolTest
import LiquidityPoolApi from './LiquidityPool';
const endpoint = '/frontoffice/api/liquidity-pool/get-total-payout';
jest.mock(endpoint, () => ({
getUsersTotalPayout: jest.fn(() => Promise.resolve({ data: { payout: 100.21 } }))
}));
describe('LiquidityPool API: getUsersTotalPayout', () => {
it('should make a request when we get images', () => {
// const testApi = new LiquidityPoolApi();
expect(LiquidityPoolApi.getUsersTotalPayout).toHaveBeenCalledWith(endpoint, 'GET');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment