2020-06-13 11:46:20 +02:00
|
|
|
import testServer from 'server/tests/testServer';
|
2020-08-03 16:31:20 +02:00
|
|
|
import { gql } from '@apollo/client';
|
2020-06-13 11:46:20 +02:00
|
|
|
|
|
|
|
jest.mock('ln-service');
|
|
|
|
|
|
|
|
describe('Chain Resolvers', () => {
|
|
|
|
test('getChainBalance', async () => {
|
|
|
|
const getChainBalance = gql`
|
2020-08-03 16:31:20 +02:00
|
|
|
query {
|
|
|
|
getChainBalance
|
2020-06-13 11:46:20 +02:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
const { query } = testServer();
|
|
|
|
const res = await query({
|
|
|
|
query: getChainBalance,
|
|
|
|
});
|
|
|
|
expect(res.errors).toBe(undefined);
|
|
|
|
expect(res).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
test('getPendingChainBalance', async () => {
|
|
|
|
const getPendingChainBalance = gql`
|
2020-08-03 16:31:20 +02:00
|
|
|
query {
|
|
|
|
getPendingChainBalance
|
2020-06-13 11:46:20 +02:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
const { query } = testServer();
|
|
|
|
const res = await query({
|
|
|
|
query: getPendingChainBalance,
|
|
|
|
});
|
|
|
|
expect(res.errors).toBe(undefined);
|
|
|
|
expect(res).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|