@bigbinary/neeto-commons-frontend 2.0.100 → 2.0.102

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/cypress-utils.js CHANGED
@@ -130,7 +130,7 @@ var initializeCredentials = function initializeCredentials(stagingData) {
130
130
  };
131
131
 
132
132
  var allPath = function allPath() {
133
- return "".concat(Cypress.config("baseUrl")).concat(getUrl("**"));
133
+ return "".concat(Cypress.config("baseUrl"), "**");
134
134
  };
135
135
  var requestApis = {
136
136
  countries: getUrl("countries"),
@@ -144,7 +144,7 @@ var requestApis = {
144
144
  return "/team_members/teams/".concat(id);
145
145
  }
146
146
  },
147
- allChatPath: "https://neetokbhelp.neetochat.net".concat(getUrl("**")),
147
+ allChatPath: "https://*.neetochat.net".concat(getUrl("**")),
148
148
  myProfilePath: function myProfilePath(subdomain) {
149
149
  return "https://".concat(subdomain, ".neetoauth.net/my/profile");
150
150
  },
@@ -308,8 +308,9 @@ var initCustomCommands = function initCustomCommands() {
308
308
  });
309
309
  Cypress.Commands.add("interceptApi", function (alias) {
310
310
  var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
311
- return cy.intercept({
311
+ return times > 0 && cy.intercept({
312
312
  url: requestApis.allPath,
313
+ resourceType: "xhr",
313
314
  times: times
314
315
  }).as(alias);
315
316
  });
@@ -609,9 +610,9 @@ var memberTexts = {
609
610
  accountActivatedToastMessage: function accountActivatedToastMessage(name) {
610
611
  return "".concat(name, "'s account has been activated.");
611
612
  },
612
- activateMember: "Activate member",
613
+ activateMember: "Activate member?",
613
614
  activateMemberAlertMessage: function activateMemberAlertMessage(email) {
614
- return "You are activating ".concat(email, ". Are you sure you want to proceed?");
615
+ return "You are activating the member ".concat(email, ".");
615
616
  },
616
617
  addMemberToProducts: function addMemberToProducts(email) {
617
618
  return "Add ".concat(email, " to the following neeto products.");
@@ -619,9 +620,9 @@ var memberTexts = {
619
620
  deactivateAccountToastMessage: function deactivateAccountToastMessage(name) {
620
621
  return "".concat(name, "'s account has been deactivated.");
621
622
  },
622
- deactivateMember: "Deactivate member",
623
+ deactivateMember: "Deactivate member?",
623
624
  deactivateMemberAlertMessage: function deactivateMemberAlertMessage(email) {
624
- return "You are deactivating ".concat(email, ". Are you sure you want to proceed?");
625
+ return "You are deactivating the member ".concat(email, ".");
625
626
  },
626
627
  editMember: "Edit member",
627
628
  inviteMessage: function inviteMessage(_ref) {
@@ -639,9 +640,9 @@ var memberTexts = {
639
640
  searchMembers: "Search members",
640
641
  noDataTitle: "There are no members to show",
641
642
  editor: "Editor",
642
- changeRole: "Change role",
643
+ changeRole: "Change role?",
643
644
  changeRoleAlertMsg: function changeRoleAlertMsg(member, role) {
644
- return "You are changing role of ".concat(member, " to ").concat(role, ". Are you sure you want to proceed?");
645
+ return "You are changing the role of ".concat(member, " to ").concat(role, ".");
645
646
  },
646
647
  collaborator: "Collaborator"
647
648
  };
@@ -1219,6 +1220,19 @@ var verifyWhatsNewTab = function verifyWhatsNewTab(whatsNewHeading) {
1219
1220
  cy.get(helpIconSelectors.whatsNewWidgetCloseButton).last().click();
1220
1221
  cy.get(helpIconSelectors.whatsNewWidgetInfo).should("not.exist");
1221
1222
  };
1223
+ var waitForChatWidget = function waitForChatWidget() {
1224
+ var timeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
1225
+ var defaultWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
1226
+ if (timeOut === 0) return;
1227
+ cy.ifNotExist(chatWidgetSelectors.widgetIframe, function () {
1228
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
1229
+ cy.wait(defaultWait);
1230
+ navigationUtils.clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.liveChat);
1231
+ cy.ifNotExist(chatWidgetSelectors.widgetIframe, function () {
1232
+ waitForChatWidget(timeOut - 1);
1233
+ });
1234
+ });
1235
+ };
1222
1236
  var verifyChatWithUsTab = function verifyChatWithUsTab(_ref3) {
1223
1237
  var alias = _ref3.alias,
1224
1238
  _ref3$requestCount = _ref3.requestCount,
@@ -1230,6 +1244,7 @@ var verifyChatWithUsTab = function verifyChatWithUsTab(_ref3) {
1230
1244
  });
1231
1245
  clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.liveChat);
1232
1246
  requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
1247
+ waitForChatWidget();
1233
1248
  cy.withinIframe(chatWidgetSelectors.widgetIframe, function () {
1234
1249
  requestCount && cy.interceptNonVersionedApi({
1235
1250
  url: requestApis.allChatPath,