forked from MONEI/Shopify-api-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproduct-resource-feedback.test.js
More file actions
38 lines (28 loc) · 1.07 KB
/
product-resource-feedback.test.js
File metadata and controls
38 lines (28 loc) · 1.07 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
describe('Shopify#productResourceFeedback', () => {
'use strict';
const expect = require('chai').expect;
const fixtures = require('./fixtures/product-resource-feedback');
const common = require('./common');
const shopify = common.shopify;
const scope = common.scope;
afterEach(() => expect(scope.isDone()).to.be.true);
it('creates a resource feedback', () => {
const input = fixtures.req.create;
const output = fixtures.res.create;
scope
.post('/admin/products/632910392/resource_feedback.json', input)
.reply(201, output);
return shopify.productResourceFeedback
.create(632910392, input.resource_feedback)
.then((data) => expect(data).to.deep.equal(output.resource_feedback));
});
it('gets a list of resource feedbacks', () => {
const output = fixtures.res.list;
scope
.get('/admin/products/632910392/resource_feedback.json')
.reply(200, output);
return shopify.productResourceFeedback
.list(632910392)
.then((data) => expect(data).to.deep.equal(output.resource_feedback));
});
});