-
-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathshipping-zone.test.js
More file actions
33 lines (23 loc) · 927 Bytes
/
shipping-zone.test.js
File metadata and controls
33 lines (23 loc) · 927 Bytes
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
describe('Shopify#shippingZone', () => {
'use strict';
const expect = require('chai').expect;
const fixtures = require('./fixtures/shipping-zone');
const common = require('./common');
const shopify = common.shopify;
const scope = common.scope;
afterEach(() => expect(scope.pendingMocks()).to.deep.equal([]));
it('gets a list of all shipping zones (1/2)', () => {
const output = fixtures.res.list;
scope.get('/admin/shipping_zones.json').reply(200, output);
return shopify.shippingZone
.list()
.then((data) => expect(data).to.deep.equal(output.shipping_zones));
});
it('gets a list of all shipping zones (2/2)', () => {
const output = fixtures.res.list;
scope.get('/admin/shipping_zones.json?foo=bar').reply(200, output);
return shopify.shippingZone
.list({ foo: 'bar' })
.then((data) => expect(data).to.deep.equal(output.shipping_zones));
});
});