-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount-test.js
More file actions
49 lines (47 loc) · 1.23 KB
/
account-test.js
File metadata and controls
49 lines (47 loc) · 1.23 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
import 'steal-mocha';
import chai from 'chai';
import {Account} from './account';
const assert = chai.assert;
describe('models/account', function () {
it('gets all account information', function (done) {
Account.getList().then(function (accounts) {
assert.equal(accounts.length, 1);
assert.equal(accounts[0].email, 'mark@bitovi.com');
done();
});
});
it('gets specific account information', function (done) {
Account.get({id: 614}).then(function (account) {
assert.equal(account.email, 'mark@bitovi.com');
done();
});
});
it('creates a new account', function (done) {
const newAccount = new Account({
name: 'name',
email: 'example@example.com',
organizations: [{
id: 129,
name: 'Wow Bao'
}]
});
assert.equal(newAccount.email, 'example@example.com');
done();
});
it('checks to see if an account has multiple organizations', function (done) {
const newAccount = new Account({
id: 123,
name: 'name',
email: 'example@example.com',
organizations: [{
id: 129,
name: 'Wow Bao'
}]
});
assert.equal(newAccount.hasMultipleOrganizations(), false);
Account.get({id: 614}).then(function (account) {
assert.equal(account.hasMultipleOrganizations(), true);
done();
});
});
});