@dhyasama/totem-models 4.6.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +14 -0
- package/lib/Document.js +5 -1
- package/lib/Message.js +1 -1
- package/lib/Organization.js +4 -0
- package/lib/Person.js +5 -1
- package/package-lock.json +1854 -0
- package/package.json +1 -1
- package/test/Document.js +17 -4
- package/test/Message.js +2 -1
- package/test/Organization.js +8 -8
- package/test/Person.js +25 -0
package/package.json
CHANGED
package/test/Document.js
CHANGED
|
@@ -26,6 +26,15 @@ describe('Document', function() {
|
|
|
26
26
|
clearDB(done);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
before(function (done) {
|
|
30
|
+
Person.collection.dropIndexes(function (err, result) {
|
|
31
|
+
should.not.exist(err);
|
|
32
|
+
should.exist(result);
|
|
33
|
+
result.should.equal(true);
|
|
34
|
+
return done();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
29
38
|
before(function(done) {
|
|
30
39
|
|
|
31
40
|
interaction = new Interaction({
|
|
@@ -140,7 +149,8 @@ describe('Document', function() {
|
|
|
140
149
|
s3: {
|
|
141
150
|
bucket: 'totem',
|
|
142
151
|
key: 'docs'
|
|
143
|
-
}
|
|
152
|
+
},
|
|
153
|
+
type: 'other'
|
|
144
154
|
}, Interaction, interaction._id, function(err, result) {
|
|
145
155
|
|
|
146
156
|
should.not.exist(err);
|
|
@@ -166,7 +176,8 @@ describe('Document', function() {
|
|
|
166
176
|
s3: {
|
|
167
177
|
bucket: 'totem',
|
|
168
178
|
key: 'docs'
|
|
169
|
-
}
|
|
179
|
+
},
|
|
180
|
+
type: 'deals'
|
|
170
181
|
}, Message, message._id, function(err, result) {
|
|
171
182
|
|
|
172
183
|
should.not.exist(err);
|
|
@@ -192,7 +203,8 @@ describe('Document', function() {
|
|
|
192
203
|
s3: {
|
|
193
204
|
bucket: 'totem',
|
|
194
205
|
key: 'docs'
|
|
195
|
-
}
|
|
206
|
+
},
|
|
207
|
+
type: 'portfolio'
|
|
196
208
|
}, Organization, org._id, function(err, result) {
|
|
197
209
|
|
|
198
210
|
should.not.exist(err);
|
|
@@ -220,7 +232,8 @@ describe('Document', function() {
|
|
|
220
232
|
s3: {
|
|
221
233
|
bucket: 'totem',
|
|
222
234
|
key: 'docs'
|
|
223
|
-
}
|
|
235
|
+
},
|
|
236
|
+
type: 'other'
|
|
224
237
|
}, Person, person._id, function(err, result) {
|
|
225
238
|
|
|
226
239
|
should.not.exist(err);
|
package/test/Message.js
CHANGED
package/test/Organization.js
CHANGED
|
@@ -23,7 +23,7 @@ var someOtherLp;
|
|
|
23
23
|
var account;
|
|
24
24
|
var customer1, customer2;
|
|
25
25
|
|
|
26
|
-
describe
|
|
26
|
+
describe('Organization', function() {
|
|
27
27
|
|
|
28
28
|
var org1, org2, org3, org4, org5;
|
|
29
29
|
var mergeId = new mongoose.Types.ObjectId();
|
|
@@ -373,7 +373,7 @@ describe.only('Organization', function() {
|
|
|
373
373
|
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
-
describe
|
|
376
|
+
describe('General', function () {
|
|
377
377
|
|
|
378
378
|
it('it soft deletes an org', function (done) {
|
|
379
379
|
|
|
@@ -1133,7 +1133,7 @@ describe.only('Organization', function() {
|
|
|
1133
1133
|
|
|
1134
1134
|
var org;
|
|
1135
1135
|
|
|
1136
|
-
it
|
|
1136
|
+
it('gets deal statuses for a customer', function(done) {
|
|
1137
1137
|
|
|
1138
1138
|
var statuses = customer1.customer.deals.activeStatuses;
|
|
1139
1139
|
statuses.length.should.equal(3);
|
|
@@ -1176,7 +1176,7 @@ describe.only('Organization', function() {
|
|
|
1176
1176
|
|
|
1177
1177
|
});
|
|
1178
1178
|
|
|
1179
|
-
it
|
|
1179
|
+
it('adds a deal again', function(done) {
|
|
1180
1180
|
|
|
1181
1181
|
var threwError = false;
|
|
1182
1182
|
|
|
@@ -1195,7 +1195,7 @@ describe.only('Organization', function() {
|
|
|
1195
1195
|
|
|
1196
1196
|
});
|
|
1197
1197
|
|
|
1198
|
-
it
|
|
1198
|
+
it('adds a deal with an inactive state', function(done) {
|
|
1199
1199
|
|
|
1200
1200
|
var threwError = false;
|
|
1201
1201
|
|
|
@@ -1212,7 +1212,7 @@ describe.only('Organization', function() {
|
|
|
1212
1212
|
|
|
1213
1213
|
});
|
|
1214
1214
|
|
|
1215
|
-
it
|
|
1215
|
+
it('adds a deal for another customer', function(done) {
|
|
1216
1216
|
|
|
1217
1217
|
var org2 = new Organization();
|
|
1218
1218
|
org2.name = 'Newest Co';
|
|
@@ -1241,7 +1241,7 @@ describe.only('Organization', function() {
|
|
|
1241
1241
|
|
|
1242
1242
|
});
|
|
1243
1243
|
|
|
1244
|
-
it
|
|
1244
|
+
it('gets deals for non-customer process', function(done) {
|
|
1245
1245
|
|
|
1246
1246
|
var temp = config.CUSTOMER_ID;
|
|
1247
1247
|
config.CUSTOMER_ID = 'GLOBAL_PROCESS';
|
|
@@ -1289,7 +1289,7 @@ describe.only('Organization', function() {
|
|
|
1289
1289
|
|
|
1290
1290
|
});
|
|
1291
1291
|
|
|
1292
|
-
describe
|
|
1292
|
+
describe('State', function() {
|
|
1293
1293
|
|
|
1294
1294
|
it('gets ipo info', function(done) {
|
|
1295
1295
|
|
package/test/Person.js
CHANGED
|
@@ -52,12 +52,17 @@ describe('Person', function() {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
before(function (done) {
|
|
55
|
+
|
|
55
56
|
Person.collection.dropIndexes(function (err, result) {
|
|
57
|
+
|
|
56
58
|
should.not.exist(err);
|
|
57
59
|
should.exist(result);
|
|
58
60
|
result.should.equal(true);
|
|
61
|
+
|
|
59
62
|
return done();
|
|
63
|
+
|
|
60
64
|
});
|
|
65
|
+
|
|
61
66
|
});
|
|
62
67
|
|
|
63
68
|
before(function (done) {
|
|
@@ -208,6 +213,26 @@ describe('Person', function() {
|
|
|
208
213
|
|
|
209
214
|
}); // end adds a person
|
|
210
215
|
|
|
216
|
+
it.skip('tries to add another person with the same email', function(done) {
|
|
217
|
+
|
|
218
|
+
var p = new Person();
|
|
219
|
+
p.name.first = 'Jesty';
|
|
220
|
+
p.name.last = 'McJester';
|
|
221
|
+
p.slug = 'jesty-mcjester';
|
|
222
|
+
|
|
223
|
+
p.contact.email.push({
|
|
224
|
+
type: 'work',
|
|
225
|
+
email: 'dhyasama+test@gmail.com',
|
|
226
|
+
primary: true
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
Person.upsert(p, 'test', function(err, updatedPerson) {
|
|
230
|
+
should.exist(err);
|
|
231
|
+
done();
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
});
|
|
235
|
+
|
|
211
236
|
it('it relates 2 people', function(done) {
|
|
212
237
|
|
|
213
238
|
person2.relatePerson(person.id);
|