forked from MONEI/Shopify-api-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbalance.test.js
More file actions
49 lines (36 loc) · 1.29 KB
/
balance.test.js
File metadata and controls
49 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
describe('Shopify#balance', () => {
'use strict';
const expect = require('chai').expect;
const fixtures = require('./fixtures/balance');
const common = require('./common');
const shopify = common.shopify;
const scope = common.scope;
afterEach(() => expect(scope.isDone()).to.be.true);
it('gets the current balance', () => {
const output = fixtures.res.list;
scope.get('/admin/shopify_payments/balance.json').reply(200, output);
return shopify.balance
.list()
.then((data) => expect(data).to.deep.equal(output.balance));
});
it('gets a list of balance transactions (1/2)', () => {
const output = fixtures.res.transactions;
scope
.get('/admin/shopify_payments/balance/transactions.json')
.reply(200, output);
return shopify.balance
.transactions()
.then((data) => expect(data).to.deep.equal(output.transactions));
});
it('gets a list of balance transactions (2/2)', () => {
const output = fixtures.res.transactions;
const params = { payout_id: 623721858 };
scope
.get('/admin/shopify_payments/balance/transactions.json')
.query(params)
.reply(200, output);
return shopify.balance
.transactions(params)
.then((data) => expect(data).to.deep.equal(output.transactions));
});
});