@atomic-testing/component-driver-mui-v9 0.88.0 → 0.90.0

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/dist/index.cjs CHANGED
@@ -599,10 +599,10 @@ var DialogDriver = class extends _atomic_testing_core.ContainerDriver {
599
599
  content: option?.content ?? {}
600
600
  });
601
601
  }
602
- overriddenParentLocator() {
602
+ static overriddenParentLocator() {
603
603
  return dialogRootLocator;
604
604
  }
605
- overrideLocatorRelativePosition() {
605
+ static overrideLocatorRelativePosition() {
606
606
  return "Same";
607
607
  }
608
608
  async getTitle() {
@@ -682,8 +682,8 @@ const defaultTransitionDuration = 250;
682
682
  * `closeByBackdrop`.
683
683
  *
684
684
  * Subclasses supply {@link getSurfaceLocator} (the element whose visibility means
685
- * "open") and, when the overlay is portal-rendered, override
686
- * `overriddenParentLocator()`/`overrideLocatorRelativePosition()` to re-root.
685
+ * "open") and, when the overlay is portal-rendered, override the static
686
+ * `overriddenParentLocator()`/`overrideLocatorRelativePosition()` portal hooks to re-root.
687
687
  *
688
688
  * `closeByEscape` is intentionally absent: keyboard dismissal needs a key-press
689
689
  * primitive the `Interactor` interface does not yet expose, which would have to be
@@ -769,10 +769,10 @@ var DrawerDriver = class extends OverlayDriver {
769
769
  content: option?.content ?? {}
770
770
  });
771
771
  }
772
- overriddenParentLocator() {
772
+ static overriddenParentLocator() {
773
773
  return drawerRootLocator;
774
774
  }
775
- overrideLocatorRelativePosition() {
775
+ static overrideLocatorRelativePosition() {
776
776
  return "Same";
777
777
  }
778
778
  getSurfaceLocator() {
@@ -881,12 +881,12 @@ var InputDriver = class extends _atomic_testing_core.ComponentDriver {
881
881
  //#endregion
882
882
  //#region src/errors/MenuItemDisabledError.ts
883
883
  const MenuItemDisabledErrorId = "MenuItemDisabledError";
884
- function getErrorMessage$1(label) {
884
+ function getErrorMessage(label) {
885
885
  return `The menu item with label: ${label} is disabled`;
886
886
  }
887
887
  var MenuItemDisabledError = class extends _atomic_testing_core.ErrorBase {
888
888
  constructor(label, driver) {
889
- super(getErrorMessage$1(label), driver);
889
+ super(getErrorMessage(label), driver);
890
890
  this.label = label;
891
891
  this.driver = driver;
892
892
  this.name = MenuItemDisabledErrorId;
@@ -936,14 +936,10 @@ var ListDriver = class extends _atomic_testing_core.ListComponentDriver {
936
936
  //#endregion
937
937
  //#region src/errors/MenuItemNotFoundError.ts
938
938
  const MenuItemNotFoundErrorId = "MenuItemNotFoundError";
939
- function getErrorMessage(label) {
940
- return `Cannot find menu item with label: ${label}`;
941
- }
942
- var MenuItemNotFoundError = class extends _atomic_testing_core.ErrorBase {
939
+ var MenuItemNotFoundError = class extends _atomic_testing_core.ItemNotFoundError {
943
940
  constructor(label, driver) {
944
- super(getErrorMessage(label), driver);
941
+ super(label, driver, `Cannot find menu item with label: ${label}`);
945
942
  this.label = label;
946
- this.driver = driver;
947
943
  this.name = MenuItemNotFoundErrorId;
948
944
  }
949
945
  };
@@ -975,10 +971,10 @@ var MenuDriver = class extends _atomic_testing_core.ComponentDriver {
975
971
  parts: parts$6
976
972
  });
977
973
  }
978
- overriddenParentLocator() {
974
+ static overriddenParentLocator() {
979
975
  return menuRootLocator;
980
976
  }
981
- overrideLocatorRelativePosition() {
977
+ static overrideLocatorRelativePosition() {
982
978
  return "Same";
983
979
  }
984
980
  async getMenuItemByLabel(label) {
@@ -1323,17 +1319,11 @@ var RatingDriver = class extends _atomic_testing_core.ComponentDriver {
1323
1319
  return this.interactor.hasCssClass(this.locator, disabledClassName);
1324
1320
  }
1325
1321
  async setValue(value) {
1326
- const currentValue = await this.getValue();
1327
- if (value === currentValue) return true;
1328
- const valueToClick = value ?? currentValue;
1329
- if (valueToClick == null) return true;
1330
- const targetLocator = _atomic_testing_core.locatorUtil.append(this.parts.choices.locator, (0, _atomic_testing_core.byValue)(valueToClick.toString(), "Same"));
1322
+ if (value === await this.getValue()) return true;
1323
+ const targetValue = value == null ? "" : value.toString();
1324
+ const targetLocator = _atomic_testing_core.locatorUtil.append(this.parts.choices.locator, (0, _atomic_testing_core.byValue)(targetValue, "Same"));
1331
1325
  const targetExists = await this.interactor.exists(targetLocator);
1332
- if (targetExists) {
1333
- const id = await this.interactor.getAttribute(targetLocator, "id");
1334
- const labelLocator = _atomic_testing_core.locatorUtil.append(this.locator, (0, _atomic_testing_core.byCssSelector)(`label[for="${id}"]`));
1335
- await this.interactor.click(labelLocator);
1336
- }
1326
+ if (targetExists) await this.interactor.activate(targetLocator);
1337
1327
  return targetExists;
1338
1328
  }
1339
1329
  get driverName() {