forked from MONEI/Shopify-api-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.test.js
More file actions
43 lines (30 loc) · 1.05 KB
/
user.test.js
File metadata and controls
43 lines (30 loc) · 1.05 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
describe('Shopify#user', () => {
'use strict';
const expect = require('chai').expect;
const fixtures = require('./fixtures/user');
const common = require('./common');
const shopify = common.shopify;
const scope = common.scope;
afterEach(() => expect(scope.isDone()).to.be.true);
it('gets a list of all users', () => {
const output = fixtures.res.list;
scope.get('/admin/users.json').reply(200, output);
return shopify.user
.list()
.then((data) => expect(data).to.deep.equal(output.users));
});
it('gets a single user by its ID', () => {
const output = fixtures.res.get;
scope.get('/admin/users/799407056.json').reply(200, output);
return shopify.user
.get(799407056)
.then((data) => expect(data).to.deep.equal(output.user));
});
it('gets the current logged-in user', () => {
const output = fixtures.res.current;
scope.get('/admin/users/current.json').reply(200, output);
return shopify.user
.current()
.then((data) => expect(data).to.deep.equal(output.user));
});
});