@tellescope/sdk 1.5.2 → 1.5.3

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":"AAw/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;AAwJD,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,qBAuJhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
1
+ {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AAw/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;AAiMD,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,qBAuJhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
@@ -3327,40 +3327,88 @@ var addToJourneyTests = function () { return __awaiter(void 0, void 0, void 0, f
3327
3327
  }
3328
3328
  });
3329
3329
  }); };
3330
+ var directAutomatedActionTest = function () { return __awaiter(void 0, void 0, void 0, function () {
3331
+ var enduser, action;
3332
+ return __generator(this, function (_a) {
3333
+ switch (_a.label) {
3334
+ case 0:
3335
+ (0, testing_1.log_header)("Manual Action Tests");
3336
+ return [4 /*yield*/, sdk.api.endusers.createOne({ fname: 'test' })];
3337
+ case 1:
3338
+ enduser = _a.sent();
3339
+ return [4 /*yield*/, sdk.api.automated_actions.createOne({
3340
+ event: {
3341
+ type: 'onJourneyStart',
3342
+ info: {}
3343
+ },
3344
+ action: {
3345
+ type: 'setEnduserStatus',
3346
+ info: { status: "Working" }
3347
+ },
3348
+ enduserId: enduser.id,
3349
+ processAfter: 0,
3350
+ status: 'active',
3351
+ automationStepId: constants_1.PLACEHOLDER_ID,
3352
+ journeyId: constants_1.PLACEHOLDER_ID,
3353
+ })];
3354
+ case 2:
3355
+ action = _a.sent();
3356
+ return [4 /*yield*/, (0, testing_1.wait)(undefined, 2000)];
3357
+ case 3:
3358
+ _a.sent();
3359
+ return [4 /*yield*/, (0, testing_1.async_test)("Enduser status set by manual automated action", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e.journeys) === null || _a === void 0 ? void 0 : _a[constants_1.PLACEHOLDER_ID]) === 'Working'; } })];
3360
+ case 4:
3361
+ _a.sent();
3362
+ return [4 /*yield*/, (0, testing_1.async_test)("Automated action is finished", function () { return sdk.api.automated_actions.getOne(action.id); }, { onResult: function (e) { return e.status === 'finished'; } })];
3363
+ case 5:
3364
+ _a.sent();
3365
+ return [4 /*yield*/, Promise.all([
3366
+ sdk.api.endusers.deleteOne(enduser.id),
3367
+ sdk.api.automated_actions.deleteOne(action.id),
3368
+ ])];
3369
+ case 6:
3370
+ _a.sent();
3371
+ return [2 /*return*/];
3372
+ }
3373
+ });
3374
+ }); };
3330
3375
  var automation_events_tests = function () { return __awaiter(void 0, void 0, void 0, function () {
3331
3376
  return __generator(this, function (_a) {
3332
3377
  switch (_a.label) {
3333
3378
  case 0:
3334
3379
  (0, testing_1.log_header)("Automation Events");
3335
- return [4 /*yield*/, (0, exports.formsSubmittedNoUnsubmittedTest)()];
3380
+ return [4 /*yield*/, directAutomatedActionTest()];
3336
3381
  case 1:
3337
3382
  _a.sent();
3338
- return [4 /*yield*/, (0, exports.automationSameJourneyTests)()];
3383
+ return [4 /*yield*/, (0, exports.formsSubmittedNoUnsubmittedTest)()];
3339
3384
  case 2:
3340
3385
  _a.sent();
3341
- return [4 /*yield*/, (0, exports.formsUnsubmittedTest)()];
3386
+ return [4 /*yield*/, (0, exports.automationSameJourneyTests)()];
3342
3387
  case 3:
3343
3388
  _a.sent();
3344
- return [4 /*yield*/, (0, exports.formsUnsubmittedCancelConditionTest)()];
3389
+ return [4 /*yield*/, (0, exports.formsUnsubmittedTest)()];
3345
3390
  case 4:
3346
3391
  _a.sent();
3347
- return [4 /*yield*/, (0, exports.formUnsubmittedCancelConditionTest)()];
3392
+ return [4 /*yield*/, (0, exports.formsUnsubmittedCancelConditionTest)()];
3348
3393
  case 5:
3349
3394
  _a.sent();
3350
- return [4 /*yield*/, addToJourneyTests()];
3395
+ return [4 /*yield*/, (0, exports.formUnsubmittedCancelConditionTest)()];
3351
3396
  case 6:
3352
3397
  _a.sent();
3353
- return [4 /*yield*/, sequenceTests()];
3398
+ return [4 /*yield*/, addToJourneyTests()];
3354
3399
  case 7:
3355
3400
  _a.sent();
3356
- return [4 /*yield*/, formEventTests()];
3401
+ return [4 /*yield*/, sequenceTests()];
3357
3402
  case 8:
3358
3403
  _a.sent();
3359
- return [4 /*yield*/, ticketEventTests()];
3404
+ return [4 /*yield*/, formEventTests()];
3360
3405
  case 9:
3361
3406
  _a.sent();
3362
- return [4 /*yield*/, removeFromJourneyTests()];
3407
+ return [4 /*yield*/, ticketEventTests()];
3363
3408
  case 10:
3409
+ _a.sent();
3410
+ return [4 /*yield*/, removeFromJourneyTests()];
3411
+ case 11:
3364
3412
  _a.sent();
3365
3413
  return [2 /*return*/];
3366
3414
  }
@@ -4982,22 +5030,4 @@ var tests = {
4982
5030
  }
4983
5031
  });
4984
5032
  }); })();
4985
- sdk.api.automated_actions.createOne({
4986
- event: {
4987
- type: "onJourneyStart",
4988
- info: {},
4989
- },
4990
- action: {
4991
- type: 'sendEmail',
4992
- info: {
4993
- senderId: 'USER_ID_HERE',
4994
- templateId: 'TEMPLATE_ID_HERE',
4995
- }
4996
- },
4997
- enduserId: 'ENDUSER_ID_HERE',
4998
- status: 'active',
4999
- processAfter: Date.now(),
5000
- automationStepId: 'SOME_PLACEHOLDER_HERE',
5001
- journeyId: 'SOME_PLACEHOLDER_HERE',
5002
- });
5003
5033
  //# sourceMappingURL=tests.js.map