@bigbinary/neeto-playwright-commons 1.10.8 → 1.10.10

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/index.cjs.js CHANGED
@@ -336,6 +336,7 @@ const COMMON_SELECTORS = {
336
336
  subTitleHeading: "menubar-subtitle-heading",
337
337
  noDataTitle: "no-data-title",
338
338
  noDataDescription: "no-data-description",
339
+ noDataHelpText: "no-data-help-text",
339
340
  backdrop: "neeto-backdrop",
340
341
  menuBarHeading: "menubar-heading",
341
342
  dropdownWrapper: "nui-select-container-wrapper",
@@ -6230,7 +6231,7 @@ var utils$k = {};
6230
6231
  */
6231
6232
 
6232
6233
  exports.escapeNode = (block, n = 0, type) => {
6233
- let node = block.nodes[n];
6234
+ const node = block.nodes[n];
6234
6235
  if (!node) return;
6235
6236
 
6236
6237
  if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
@@ -6299,13 +6300,23 @@ var utils$k = {};
6299
6300
 
6300
6301
  exports.flatten = (...args) => {
6301
6302
  const result = [];
6303
+
6302
6304
  const flat = arr => {
6303
6305
  for (let i = 0; i < arr.length; i++) {
6304
- let ele = arr[i];
6305
- Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele);
6306
+ const ele = arr[i];
6307
+
6308
+ if (Array.isArray(ele)) {
6309
+ flat(ele);
6310
+ continue;
6311
+ }
6312
+
6313
+ if (ele !== undefined) {
6314
+ result.push(ele);
6315
+ }
6306
6316
  }
6307
6317
  return result;
6308
6318
  };
6319
+
6309
6320
  flat(args);
6310
6321
  return result;
6311
6322
  };
@@ -6314,9 +6325,9 @@ var utils$k = {};
6314
6325
  const utils$j = utils$k;
6315
6326
 
6316
6327
  var stringify$4 = (ast, options = {}) => {
6317
- let stringify = (node, parent = {}) => {
6318
- let invalidBlock = options.escapeInvalid && utils$j.isInvalidBrace(parent);
6319
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
6328
+ const stringify = (node, parent = {}) => {
6329
+ const invalidBlock = options.escapeInvalid && utils$j.isInvalidBrace(parent);
6330
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
6320
6331
  let output = '';
6321
6332
 
6322
6333
  if (node.value) {
@@ -6331,7 +6342,7 @@ var stringify$4 = (ast, options = {}) => {
6331
6342
  }
6332
6343
 
6333
6344
  if (node.nodes) {
6334
- for (let child of node.nodes) {
6345
+ for (const child of node.nodes) {
6335
6346
  output += stringify(child);
6336
6347
  }
6337
6348
  }
@@ -6705,7 +6716,7 @@ const toMaxLen = (input, maxLength) => {
6705
6716
  return negative ? ('-' + input) : input;
6706
6717
  };
6707
6718
 
6708
- const toSequence = (parts, options) => {
6719
+ const toSequence = (parts, options, maxLen) => {
6709
6720
  parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6710
6721
  parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
6711
6722
 
@@ -6715,11 +6726,11 @@ const toSequence = (parts, options) => {
6715
6726
  let result;
6716
6727
 
6717
6728
  if (parts.positives.length) {
6718
- positives = parts.positives.join('|');
6729
+ positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
6719
6730
  }
6720
6731
 
6721
6732
  if (parts.negatives.length) {
6722
- negatives = `-(${prefix}${parts.negatives.join('|')})`;
6733
+ negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
6723
6734
  }
6724
6735
 
6725
6736
  if (positives && negatives) {
@@ -6817,7 +6828,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
6817
6828
 
6818
6829
  if (options.toRegex === true) {
6819
6830
  return step > 1
6820
- ? toSequence(parts, options)
6831
+ ? toSequence(parts, options, maxLen)
6821
6832
  : toRegex(range, null, { wrap: false, ...options });
6822
6833
  }
6823
6834
 
@@ -6829,7 +6840,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
6829
6840
  return invalidRange(start, end, options);
6830
6841
  }
6831
6842
 
6832
-
6833
6843
  let format = options.transform || (val => String.fromCharCode(val));
6834
6844
  let a = `${start}`.charCodeAt(0);
6835
6845
  let b = `${end}`.charCodeAt(0);
@@ -6897,30 +6907,32 @@ const fill$1 = fillRange;
6897
6907
  const utils$i = utils$k;
6898
6908
 
6899
6909
  const compile$1 = (ast, options = {}) => {
6900
- let walk = (node, parent = {}) => {
6901
- let invalidBlock = utils$i.isInvalidBrace(parent);
6902
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
6903
- let invalid = invalidBlock === true || invalidNode === true;
6904
- let prefix = options.escapeInvalid === true ? '\\' : '';
6910
+ const walk = (node, parent = {}) => {
6911
+ const invalidBlock = utils$i.isInvalidBrace(parent);
6912
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
6913
+ const invalid = invalidBlock === true || invalidNode === true;
6914
+ const prefix = options.escapeInvalid === true ? '\\' : '';
6905
6915
  let output = '';
6906
6916
 
6907
6917
  if (node.isOpen === true) {
6908
6918
  return prefix + node.value;
6909
6919
  }
6920
+
6910
6921
  if (node.isClose === true) {
6922
+ console.log('node.isClose', prefix, node.value);
6911
6923
  return prefix + node.value;
6912
6924
  }
6913
6925
 
6914
6926
  if (node.type === 'open') {
6915
- return invalid ? (prefix + node.value) : '(';
6927
+ return invalid ? prefix + node.value : '(';
6916
6928
  }
6917
6929
 
6918
6930
  if (node.type === 'close') {
6919
- return invalid ? (prefix + node.value) : ')';
6931
+ return invalid ? prefix + node.value : ')';
6920
6932
  }
6921
6933
 
6922
6934
  if (node.type === 'comma') {
6923
- return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
6935
+ return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
6924
6936
  }
6925
6937
 
6926
6938
  if (node.value) {
@@ -6928,8 +6940,8 @@ const compile$1 = (ast, options = {}) => {
6928
6940
  }
6929
6941
 
6930
6942
  if (node.nodes && node.ranges > 0) {
6931
- let args = utils$i.reduce(node.nodes);
6932
- let range = fill$1(...args, { ...options, wrap: false, toRegex: true });
6943
+ const args = utils$i.reduce(node.nodes);
6944
+ const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
6933
6945
 
6934
6946
  if (range.length !== 0) {
6935
6947
  return args.length > 1 && range.length > 1 ? `(${range})` : range;
@@ -6937,10 +6949,11 @@ const compile$1 = (ast, options = {}) => {
6937
6949
  }
6938
6950
 
6939
6951
  if (node.nodes) {
6940
- for (let child of node.nodes) {
6952
+ for (const child of node.nodes) {
6941
6953
  output += walk(child, node);
6942
6954
  }
6943
6955
  }
6956
+
6944
6957
  return output;
6945
6958
  };
6946
6959
 
@@ -6954,7 +6967,7 @@ const stringify$2 = stringify$4;
6954
6967
  const utils$h = utils$k;
6955
6968
 
6956
6969
  const append = (queue = '', stash = '', enclose = false) => {
6957
- let result = [];
6970
+ const result = [];
6958
6971
 
6959
6972
  queue = [].concat(queue);
6960
6973
  stash = [].concat(stash);
@@ -6964,15 +6977,15 @@ const append = (queue = '', stash = '', enclose = false) => {
6964
6977
  return enclose ? utils$h.flatten(stash).map(ele => `{${ele}}`) : stash;
6965
6978
  }
6966
6979
 
6967
- for (let item of queue) {
6980
+ for (const item of queue) {
6968
6981
  if (Array.isArray(item)) {
6969
- for (let value of item) {
6982
+ for (const value of item) {
6970
6983
  result.push(append(value, stash, enclose));
6971
6984
  }
6972
6985
  } else {
6973
6986
  for (let ele of stash) {
6974
6987
  if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
6975
- result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
6988
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
6976
6989
  }
6977
6990
  }
6978
6991
  }
@@ -6980,9 +6993,9 @@ const append = (queue = '', stash = '', enclose = false) => {
6980
6993
  };
6981
6994
 
6982
6995
  const expand$2 = (ast, options = {}) => {
6983
- let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
6996
+ const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
6984
6997
 
6985
- let walk = (node, parent = {}) => {
6998
+ const walk = (node, parent = {}) => {
6986
6999
  node.queue = [];
6987
7000
 
6988
7001
  let p = parent;
@@ -7004,7 +7017,7 @@ const expand$2 = (ast, options = {}) => {
7004
7017
  }
7005
7018
 
7006
7019
  if (node.nodes && node.ranges > 0) {
7007
- let args = utils$h.reduce(node.nodes);
7020
+ const args = utils$h.reduce(node.nodes);
7008
7021
 
7009
7022
  if (utils$h.exceedsLimit(...args, options.step, rangeLimit)) {
7010
7023
  throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
@@ -7020,7 +7033,7 @@ const expand$2 = (ast, options = {}) => {
7020
7033
  return;
7021
7034
  }
7022
7035
 
7023
- let enclose = utils$h.encloseBrace(node);
7036
+ const enclose = utils$h.encloseBrace(node);
7024
7037
  let queue = node.queue;
7025
7038
  let block = node;
7026
7039
 
@@ -7030,7 +7043,7 @@ const expand$2 = (ast, options = {}) => {
7030
7043
  }
7031
7044
 
7032
7045
  for (let i = 0; i < node.nodes.length; i++) {
7033
- let child = node.nodes[i];
7046
+ const child = node.nodes[i];
7034
7047
 
7035
7048
  if (child.type === 'comma' && node.type === 'brace') {
7036
7049
  if (i === 1) queue.push('');
@@ -7062,7 +7075,7 @@ const expand$2 = (ast, options = {}) => {
7062
7075
  var expand_1 = expand$2;
7063
7076
 
7064
7077
  var constants$c = {
7065
- MAX_LENGTH: 1024 * 64,
7078
+ MAX_LENGTH: 10000,
7066
7079
 
7067
7080
  // Digits
7068
7081
  CHAR_0: '0', /* 0 */
@@ -7150,18 +7163,18 @@ const parse$5 = (input, options = {}) => {
7150
7163
  throw new TypeError('Expected a string');
7151
7164
  }
7152
7165
 
7153
- let opts = options || {};
7154
- let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
7166
+ const opts = options || {};
7167
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
7155
7168
  if (input.length > max) {
7156
7169
  throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
7157
7170
  }
7158
7171
 
7159
- let ast = { type: 'root', input, nodes: [] };
7160
- let stack = [ast];
7172
+ const ast = { type: 'root', input, nodes: [] };
7173
+ const stack = [ast];
7161
7174
  let block = ast;
7162
7175
  let prev = ast;
7163
7176
  let brackets = 0;
7164
- let length = input.length;
7177
+ const length = input.length;
7165
7178
  let index = 0;
7166
7179
  let depth = 0;
7167
7180
  let value;
@@ -7226,6 +7239,7 @@ const parse$5 = (input, options = {}) => {
7226
7239
 
7227
7240
  if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
7228
7241
  brackets++;
7242
+
7229
7243
  let next;
7230
7244
 
7231
7245
  while (index < length && (next = advance())) {
@@ -7281,7 +7295,7 @@ const parse$5 = (input, options = {}) => {
7281
7295
  */
7282
7296
 
7283
7297
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
7284
- let open = value;
7298
+ const open = value;
7285
7299
  let next;
7286
7300
 
7287
7301
  if (options.keepQuotes !== true) {
@@ -7313,8 +7327,8 @@ const parse$5 = (input, options = {}) => {
7313
7327
  if (value === CHAR_LEFT_CURLY_BRACE$1) {
7314
7328
  depth++;
7315
7329
 
7316
- let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
7317
- let brace = {
7330
+ const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
7331
+ const brace = {
7318
7332
  type: 'brace',
7319
7333
  open: true,
7320
7334
  close: false,
@@ -7341,7 +7355,7 @@ const parse$5 = (input, options = {}) => {
7341
7355
  continue;
7342
7356
  }
7343
7357
 
7344
- let type = 'close';
7358
+ const type = 'close';
7345
7359
  block = stack.pop();
7346
7360
  block.close = true;
7347
7361
 
@@ -7359,7 +7373,7 @@ const parse$5 = (input, options = {}) => {
7359
7373
  if (value === CHAR_COMMA$1 && depth > 0) {
7360
7374
  if (block.ranges > 0) {
7361
7375
  block.ranges = 0;
7362
- let open = block.nodes.shift();
7376
+ const open = block.nodes.shift();
7363
7377
  block.nodes = [open, { type: 'text', value: stringify$1(block) }];
7364
7378
  }
7365
7379
 
@@ -7373,7 +7387,7 @@ const parse$5 = (input, options = {}) => {
7373
7387
  */
7374
7388
 
7375
7389
  if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
7376
- let siblings = block.nodes;
7390
+ const siblings = block.nodes;
7377
7391
 
7378
7392
  if (depth === 0 || siblings.length === 0) {
7379
7393
  push({ type: 'text', value });
@@ -7400,7 +7414,7 @@ const parse$5 = (input, options = {}) => {
7400
7414
  if (prev.type === 'range') {
7401
7415
  siblings.pop();
7402
7416
 
7403
- let before = siblings[siblings.length - 1];
7417
+ const before = siblings[siblings.length - 1];
7404
7418
  before.value += prev.value + value;
7405
7419
  prev = before;
7406
7420
  block.ranges--;
@@ -7433,8 +7447,8 @@ const parse$5 = (input, options = {}) => {
7433
7447
  });
7434
7448
 
7435
7449
  // get the location of the block on parent.nodes (block's siblings)
7436
- let parent = stack[stack.length - 1];
7437
- let index = parent.nodes.indexOf(block);
7450
+ const parent = stack[stack.length - 1];
7451
+ const index = parent.nodes.indexOf(block);
7438
7452
  // replace the (invalid) block with it's nodes
7439
7453
  parent.nodes.splice(index, 1, ...block.nodes);
7440
7454
  }
@@ -7469,8 +7483,8 @@ const braces$1 = (input, options = {}) => {
7469
7483
  let output = [];
7470
7484
 
7471
7485
  if (Array.isArray(input)) {
7472
- for (let pattern of input) {
7473
- let result = braces$1.create(pattern, options);
7486
+ for (const pattern of input) {
7487
+ const result = braces$1.create(pattern, options);
7474
7488
  if (Array.isArray(result)) {
7475
7489
  output.push(...result);
7476
7490
  } else {
@@ -7604,7 +7618,7 @@ braces$1.create = (input, options = {}) => {
7604
7618
  return [input];
7605
7619
  }
7606
7620
 
7607
- return options.expand !== true
7621
+ return options.expand !== true
7608
7622
  ? braces$1.compile(input, options)
7609
7623
  : braces$1.expand(input, options);
7610
7624
  };
@@ -14141,13 +14155,13 @@ class ImageUploader {
14141
14155
  await test$1.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toBeHidden();
14142
14156
  };
14143
14157
  this.openImageLibrary = async () => {
14144
- const fetchImages = this.neetoPlaywrightUtilities.interceptMultipleResponses({
14145
- responseUrl: NEETO_ROUTES.imageUploader,
14146
- });
14147
14158
  await this.page
14148
14159
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.openAssetLibraryButton)
14149
14160
  .click();
14150
- await fetchImages;
14161
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.modalHeader)).toBeVisible({ timeout: 30000 });
14162
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
14163
+ timeout: 30000,
14164
+ });
14151
14165
  };
14152
14166
  this.cropImage = async ({ toggleAspectRatioLock = false, width = "100", height = "100", aspectRatioHeight = "9", aspectRatioWidth = "16", } = {}) => {
14153
14167
  toggleAspectRatioLock &&