@skyux/forms 15.0.0-alpha.4 → 15.0.0-alpha.6

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,10 +1,9 @@
1
1
  import { HarnessPredicate, ComponentHarness } from '@angular/cdk/testing';
2
- import { SkyComponentHarness, SkyQueryableComponentHarness, SkyInputHarness, provideSkyFileReaderTesting } from '@skyux/core/testing';
2
+ import { SkyComponentHarness, SkyQueryableComponentHarness, SkyAppTestUtility, SkyInputHarness, provideSkyFileReaderTesting } from '@skyux/core/testing';
3
3
  import { SkyHelpInlineHarness } from '@skyux/help-inline/testing';
4
4
  import { SkyStatusIndicatorHarness } from '@skyux/indicators/testing';
5
5
  import { SkyPopoverHarness } from '@skyux/popovers/testing';
6
6
  import { By } from '@angular/platform-browser';
7
- import { SkyAppTestUtility } from '@skyux-sdk/testing';
8
7
  import { SkyIconHarness } from '@skyux/icon/testing';
9
8
 
10
9
  /**
@@ -1897,24 +1896,6 @@ class SkySelectionBoxGridHarness extends SkyComponentHarness {
1897
1896
  }
1898
1897
  }
1899
1898
 
1900
- /**
1901
- * Harness for interacting with a toggle switch label component in tests.
1902
- * @internal
1903
- */
1904
- class SkyToggleSwitchLabelHarness extends ComponentHarness {
1905
- /**
1906
- * @internal
1907
- */
1908
- static { this.hostSelector = 'sky-toggle-switch-label'; }
1909
- #getLabelContent = this.locatorFor('span[skyTrim]');
1910
- /**
1911
- * Gets the text content of the toggle switch label.
1912
- */
1913
- async getText() {
1914
- return await (await this.#getLabelContent()).text();
1915
- }
1916
- }
1917
-
1918
1899
  /**
1919
1900
  * Harness for interacting with a toggle switch component in tests.
1920
1901
  */
@@ -1924,7 +1905,6 @@ class SkyToggleSwitchHarness extends SkyComponentHarness {
1924
1905
  */
1925
1906
  static { this.hostSelector = 'sky-toggle-switch'; }
1926
1907
  #getButton = this.locatorFor('button.sky-toggle-switch-button');
1927
- #getLabel = this.locatorForOptional(SkyToggleSwitchLabelHarness);
1928
1908
  #getLabelText = this.locatorForOptional('span.sky-toggle-switch-label-text');
1929
1909
  /**
1930
1910
  * Gets a `HarnessPredicate` that can be used to search for a
@@ -1976,13 +1956,7 @@ class SkyToggleSwitchHarness extends SkyComponentHarness {
1976
1956
  */
1977
1957
  async getLabelHidden() {
1978
1958
  const labelText = await this.#getLabelText();
1979
- const labelComponent = await this.#getLabel();
1980
- if (labelComponent) {
1981
- throw new Error('`labelHidden` is only supported when setting the toggle switch label via the `labelText` input.');
1982
- }
1983
- else {
1984
- return !(await labelText?.text());
1985
- }
1959
+ return !(await labelText?.text());
1986
1960
  }
1987
1961
  /**
1988
1962
  * Gets the toggle switch's label text. If the label is set via `labelText` and `labelHidden` is true,
@@ -1991,7 +1965,7 @@ class SkyToggleSwitchHarness extends SkyComponentHarness {
1991
1965
  async getLabelText() {
1992
1966
  const labelText = await (await this.#getLabelText())?.text();
1993
1967
  const ariaLabel = await this.#getAriaLabel();
1994
- return (labelText || ariaLabel || (await (await this.#getLabel())?.getText()));
1968
+ return labelText || ariaLabel || undefined;
1995
1969
  }
1996
1970
  /**
1997
1971
  * Whether the toggle switch is checked.