d5-testing-library 2.0.0-alpha.10 → 2.0.0-alpha.12

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,6 +1,6 @@
1
1
  import {
2
2
  FormEdit
3
- } from "./chunk-GSTA5R4B.mjs";
3
+ } from "./chunk-IU2SMSJW.mjs";
4
4
  export {
5
5
  FormEdit as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ListForm
3
- } from "./chunk-GSTA5R4B.mjs";
3
+ } from "./chunk-IU2SMSJW.mjs";
4
4
  export {
5
5
  ListForm as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TreeView
3
- } from "./chunk-GSTA5R4B.mjs";
3
+ } from "./chunk-IU2SMSJW.mjs";
4
4
  export {
5
5
  TreeView as default
6
6
  };
@@ -3320,15 +3320,15 @@ async function classDependencyInjector(formType) {
3320
3320
  let SubFormFactoryClass;
3321
3321
  switch (formType) {
3322
3322
  case "1" /* LIST */:
3323
- SubFormFactoryClass = (await import("./ListForm-4DCCOHKJ.mjs")).default;
3323
+ SubFormFactoryClass = (await import("./ListForm-PJOXJ3TD.mjs")).default;
3324
3324
  break;
3325
3325
  case "3" /* TREE */:
3326
- SubFormFactoryClass = (await import("./TreeView-RDCA3LGU.mjs")).default;
3326
+ SubFormFactoryClass = (await import("./TreeView-GXCLUOMI.mjs")).default;
3327
3327
  break;
3328
3328
  case "2" /* EDIT */:
3329
3329
  case "99" /* FREE_FORM */:
3330
3330
  case "4" /* REPORT */:
3331
- SubFormFactoryClass = (await import("./FormEdit-QX5S7TDU.mjs")).default;
3331
+ SubFormFactoryClass = (await import("./FormEdit-AHCGTBML.mjs")).default;
3332
3332
  break;
3333
3333
  default:
3334
3334
  throw new Error(`Unsupported form type ${formType}`);
@@ -4533,6 +4533,9 @@ var isDefined = function(value) {
4533
4533
  var isString = function(object) {
4534
4534
  return typeof object === "string";
4535
4535
  };
4536
+ var isNumeric = function(object) {
4537
+ return typeof object === "number" && isFinite(object) || !isNaN(object - parseFloat(object));
4538
+ };
4536
4539
  var isDate = function(object) {
4537
4540
  return type(object) === "date";
4538
4541
  };
@@ -4803,7 +4806,7 @@ var CALENDAR_PREVIOUS_SELECTOR = "dx-calendar-navigator-previous-month";
4803
4806
  var CALENDAR_NEXT_SELECTOR = "dx-calendar-navigator-next-month";
4804
4807
  var TEXT_EDITOR_SELECTOR = "dx-texteditor-input";
4805
4808
  var movesToCalendarEndForWeek = 3;
4806
- var movesToCalendarEndForMonth = 1;
4809
+ var movesToCalendarEndForMonth = 0;
4807
4810
  var Calendar = class extends AbstractElementWithParent {
4808
4811
  _parentCssSelector;
4809
4812
  constructor({ parentCssSelector, dateFieldDataTestID, page }) {
@@ -4816,6 +4819,7 @@ var Calendar = class extends AbstractElementWithParent {
4816
4819
  async init() {
4817
4820
  const dateField = this.page.locator(this._parentCssSelector);
4818
4821
  await dateField.locator(`.${BTN_CALENDAR_POPOVER_OPEN_SELECTOR}`).click();
4822
+ await this.root.waitFor({ state: "visible" });
4819
4823
  }
4820
4824
  async moveToCalendarEnd(count) {
4821
4825
  while (count >= 0) {
@@ -5226,7 +5230,11 @@ var FileUploader = class extends AbstractElementWithParent {
5226
5230
  const element = await this.getMedataElement();
5227
5231
  if (!element) return null;
5228
5232
  const fileModDate = (await element.getAttribute(FILE_DATE_ATTRIBUTE))?.trim();
5229
- return fileModDate ? new Date(fileModDate) : null;
5233
+ if (isNumeric(+fileModDate)) {
5234
+ const dateString = (/* @__PURE__ */ new Date(+fileModDate)).toISOString();
5235
+ return new Date(dateString.split("T")[0]);
5236
+ }
5237
+ return fileModDate ? new Date(fileModDate.split("T")[0]) : null;
5230
5238
  }
5231
5239
  /**
5232
5240
  * Returns the MIME/content type of the uploaded file from metadata.
@@ -474,7 +474,7 @@ function isEmptyValue(value) {
474
474
  }
475
475
  return false;
476
476
  }
477
- var types, isObject, isEmptyObject, type, isNull, isArray, isDefined, isString, isDate, isArrayOfDates, isUndefined;
477
+ var types, isObject, isEmptyObject, type, isNull, isArray, isDefined, isString, isNumeric, isDate, isArrayOfDates, isUndefined;
478
478
  var init_typesUtil = __esm({
479
479
  "src/utils/typesUtil.ts"() {
480
480
  "use strict";
@@ -507,6 +507,9 @@ var init_typesUtil = __esm({
507
507
  isString = function(object) {
508
508
  return typeof object === "string";
509
509
  };
510
+ isNumeric = function(object) {
511
+ return typeof object === "number" && isFinite(object) || !isNaN(object - parseFloat(object));
512
+ };
510
513
  isDate = function(object) {
511
514
  return type(object) === "date";
512
515
  };
@@ -842,7 +845,7 @@ var init_Calendar = __esm({
842
845
  CALENDAR_NEXT_SELECTOR = "dx-calendar-navigator-next-month";
843
846
  TEXT_EDITOR_SELECTOR = "dx-texteditor-input";
844
847
  movesToCalendarEndForWeek = 3;
845
- movesToCalendarEndForMonth = 1;
848
+ movesToCalendarEndForMonth = 0;
846
849
  Calendar = class extends AbstractElementWithParent {
847
850
  _parentCssSelector;
848
851
  constructor({ parentCssSelector, dateFieldDataTestID, page }) {
@@ -855,6 +858,7 @@ var init_Calendar = __esm({
855
858
  async init() {
856
859
  const dateField = this.page.locator(this._parentCssSelector);
857
860
  await dateField.locator(`.${BTN_CALENDAR_POPOVER_OPEN_SELECTOR}`).click();
861
+ await this.root.waitFor({ state: "visible" });
858
862
  }
859
863
  async moveToCalendarEnd(count) {
860
864
  while (count >= 0) {
@@ -1273,6 +1277,7 @@ var init_FileUploader = __esm({
1273
1277
  "src/pageObjects/elements/Editors/FileUploader.ts"() {
1274
1278
  "use strict";
1275
1279
  init_AbstractElementWithParent();
1280
+ init_typesUtil();
1276
1281
  FILE_NAME_SELECTOR = ".file-text";
1277
1282
  FILE_SIZE_ATTRIBUTE = "data-filesize";
1278
1283
  FILE_DATE_ATTRIBUTE = "data-moddate";
@@ -1321,7 +1326,11 @@ var init_FileUploader = __esm({
1321
1326
  const element = await this.getMedataElement();
1322
1327
  if (!element) return null;
1323
1328
  const fileModDate = (await element.getAttribute(FILE_DATE_ATTRIBUTE))?.trim();
1324
- return fileModDate ? new Date(fileModDate) : null;
1329
+ if (isNumeric(+fileModDate)) {
1330
+ const dateString = (/* @__PURE__ */ new Date(+fileModDate)).toISOString();
1331
+ return new Date(dateString.split("T")[0]);
1332
+ }
1333
+ return fileModDate ? new Date(fileModDate.split("T")[0]) : null;
1325
1334
  }
1326
1335
  /**
1327
1336
  * Returns the MIME/content type of the uploaded file from metadata.
@@ -23,7 +23,7 @@ import {
23
23
  readonlyLocator,
24
24
  wait,
25
25
  waitElementIsVisible_default
26
- } from "./chunk-GSTA5R4B.mjs";
26
+ } from "./chunk-IU2SMSJW.mjs";
27
27
  export {
28
28
  AbstractPage,
29
29
  ApiRequest,
@@ -23,7 +23,7 @@ import {
23
23
  readonlyLocator,
24
24
  wait,
25
25
  waitElementIsVisible_default
26
- } from "./chunk-GSTA5R4B.mjs";
26
+ } from "./chunk-IU2SMSJW.mjs";
27
27
  export {
28
28
  AbstractPage,
29
29
  ApiRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d5-testing-library",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.12",
4
4
  "description": "e2e testing D5 projects",
5
5
  "main": "dist/cjs/d5-testing-library.cjs",
6
6
  "module": "dist/d5-testing-library.legacy-esm.js",