@tellescope/sdk 1.30.6 → 1.30.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AA6+DA,eAAO,MAAM,kCAAkC,qBA4I9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAsK/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAkHhC,CAAA;AAED,eAAO,MAAM,+BAA+B,qBAsF3C,CAAA;AAID,eAAO,MAAM,0BAA0B,qBAqCtC,CAAA;AAyRD,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AA0eD,eAAO,MAAM,6BAA6B,qBAgCzC,CAAA;AAED,eAAO,MAAM,0BAA0B,qBAmFtC,CAAA;AAoED,eAAO,MAAM,eAAe,qBA8C3B,CAAA;AAED,eAAO,MAAM,oBAAoB,6BAsBhC,CAAA;AAED,eAAO,MAAM,oCAAoC,qBA8JhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
1
+ {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AA6+DA,eAAO,MAAM,kCAAkC,qBA4I9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAsK/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAkHhC,CAAA;AAED,eAAO,MAAM,+BAA+B,qBAsF3C,CAAA;AAID,eAAO,MAAM,0BAA0B,qBAqCtC,CAAA;AAwRD,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AA0eD,eAAO,MAAM,6BAA6B,qBAgCzC,CAAA;AAED,eAAO,MAAM,0BAA0B,qBAmFtC,CAAA;AAqED,eAAO,MAAM,eAAe,qBA8C3B,CAAA;AAED,eAAO,MAAM,oBAAoB,6BAsBhC,CAAA;AAED,eAAO,MAAM,oCAAoC,qBA8JhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
@@ -3271,33 +3271,30 @@ var addToJourneyTests = function () { return __awaiter(void 0, void 0, void 0, f
3271
3271
  case 5:
3272
3272
  // add to journey and re-add
3273
3273
  _a.sent();
3274
- return [4 /*yield*/, (0, testing_1.wait)(undefined, 250)];
3274
+ return [4 /*yield*/, (0, testing_1.async_test)("Journey state correctly set by add_to_journey (to default state)", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a, _b; return ((_a = e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) === '' || ((_b = e.journeys) === null || _b === void 0 ? void 0 : _b[journey.id]) === 'Root'; } })];
3275
3275
  case 6:
3276
- _a.sent();
3277
- return [4 /*yield*/, (0, testing_1.async_test)("Journey state correctly set by add_to_journey (to default state)", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) === ''; } })];
3278
- case 7:
3279
3276
  _a.sent();
3280
3277
  return [4 /*yield*/, (0, testing_1.wait)(undefined, 4000)]; // allow onJourneyStart step to trigger
3281
- case 8:
3278
+ case 7:
3282
3279
  _a.sent(); // allow onJourneyStart step to trigger
3283
3280
  return [4 /*yield*/, sdk.api.endusers.add_to_journey({ enduserIds: [enduser.id], journeyId: journey.id })];
3284
- case 9:
3281
+ case 8:
3285
3282
  _a.sent();
3286
3283
  return [4 /*yield*/, (0, testing_1.wait)(undefined, 4000)]; // allow onJourneyStart step to trigger
3287
- case 10:
3284
+ case 9:
3288
3285
  _a.sent(); // allow onJourneyStart step to trigger
3289
3286
  return [4 /*yield*/, (0, testing_1.async_test)("Enduser correctly added and re-added", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (es) { return es.length === 4
3290
3287
  && es.filter(function (e) { return e.status === 'cancelled' && e.automationStepId === follow.id; }).length === 1 // one afterAction is cancelled
3291
3288
  && es.filter(function (e) { return e.status === 'active' && e.automationStepId === follow.id; }).length === 1 // one afterAction is still active
3292
3289
  && es.filter(function (e) { return e.status === 'finished' && e.automationStepId === root.id; }).length === 2; } // two initial onJourneyStart
3293
3290
  })];
3294
- case 11:
3291
+ case 10:
3295
3292
  _a.sent();
3296
3293
  return [4 /*yield*/, Promise.all([
3297
3294
  sdk.api.journeys.deleteOne(journey.id),
3298
3295
  sdk.api.endusers.deleteOne(enduser.id),
3299
3296
  ])];
3300
- case 12:
3297
+ case 11:
3301
3298
  _a.sent();
3302
3299
  return [2 /*return*/];
3303
3300
  }
@@ -4376,52 +4373,55 @@ var post_comments_tests = function () { return __awaiter(void 0, void 0, void 0,
4376
4373
  })];
4377
4374
  case 6:
4378
4375
  enduserCommentInReply = _a.sent();
4379
- return [4 /*yield*/, (0, testing_1.async_test)('num replies incremented', function () { return sdk.api.post_comments.getOne({ id: postId, forumId: forumId }); }, { onResult: function (c) { return c.numReplies === 1; } })];
4376
+ return [4 /*yield*/, (0, testing_1.wait)(undefined, 500)];
4380
4377
  case 7:
4378
+ _a.sent();
4379
+ return [4 /*yield*/, (0, testing_1.async_test)('num replies incremented', function () { return sdk.api.post_comments.getOne({ id: postId, forumId: forumId }); }, { onResult: function (c) { return c.numReplies === 1; } })];
4380
+ case 8:
4381
4381
  _a.sent();
4382
4382
  return [4 /*yield*/, sdk.api.comment_likes.createOne({
4383
4383
  forumId: forumId,
4384
4384
  postId: postId,
4385
4385
  commentId: userComment.id,
4386
4386
  })];
4387
- case 8:
4387
+ case 9:
4388
4388
  userLike = _a.sent();
4389
4389
  return [4 /*yield*/, enduserSDK.api.comment_likes.createOne({
4390
4390
  forumId: forumId,
4391
4391
  postId: postId,
4392
4392
  commentId: userComment.id,
4393
4393
  })];
4394
- case 9:
4394
+ case 10:
4395
4395
  enduserLike = _a.sent();
4396
4396
  return [4 /*yield*/, (0, testing_1.async_test)('num likes incremented', function () { return sdk.api.post_comments.getOne({ id: postId, forumId: forumId }); }, { onResult: function (c) { return c.numLikes === 2; } })];
4397
- case 10:
4397
+ case 11:
4398
4398
  _a.sent();
4399
4399
  return [4 /*yield*/, (0, testing_1.async_test)('user cannot create duplicate comment like', function () { return sdk.api.comment_likes.createOne({ forumId: forumId, postId: postId, commentId: userComment.id }); }, { shouldError: true, onError: function (e) { return e.message === UniquenessViolationMessage; } })];
4400
- case 11:
4400
+ case 12:
4401
4401
  _a.sent();
4402
4402
  return [4 /*yield*/, (0, testing_1.async_test)('enduser cannot create duplicate comment like', function () { return enduserSDK.api.comment_likes.createOne({ forumId: forumId, postId: postId, commentId: userComment.id }); }, { shouldError: true, onError: function (e) { return e.message === UniquenessViolationMessage; } })];
4403
- case 12:
4403
+ case 13:
4404
4404
  _a.sent();
4405
4405
  return [4 /*yield*/, enduserSDK.api.post_comments.deleteOne(enduserCommentInReply.id)];
4406
- case 13:
4406
+ case 14:
4407
4407
  _a.sent();
4408
4408
  return [4 /*yield*/, (0, testing_1.async_test)('num comments decrementted', function () { return sdk.api.post_comments.getOne({ id: postId, forumId: forumId }); }, { onResult: function (c) { return c.numReplies === 0; } })];
4409
- case 14:
4409
+ case 15:
4410
4410
  _a.sent();
4411
4411
  return [4 /*yield*/, sdk.api.comment_likes.deleteOne(userLike.id)];
4412
- case 15:
4412
+ case 16:
4413
4413
  _a.sent();
4414
4414
  return [4 /*yield*/, enduserSDK.api.comment_likes.deleteOne(enduserLike.id)];
4415
- case 16:
4415
+ case 17:
4416
4416
  _a.sent();
4417
4417
  return [4 /*yield*/, (0, testing_1.async_test)('num likes decremented', function () { return sdk.api.post_comments.getOne({ id: postId, forumId: forumId }); }, { onResult: function (c) { return c.numLikes === 0; } })];
4418
- case 17:
4418
+ case 18:
4419
4419
  _a.sent();
4420
4420
  return [4 /*yield*/, Promise.all([
4421
4421
  sdk.api.endusers.deleteOne(enduserSDK.userInfo.id),
4422
4422
  sdk.api.forums.deleteOne(forumId)
4423
4423
  ])];
4424
- case 18:
4424
+ case 19:
4425
4425
  _a.sent();
4426
4426
  return [2 /*return*/];
4427
4427
  }