ngx-com 0.1.16 → 0.1.17

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.
Files changed (76) hide show
  1. package/fesm2022/ngx-com-components-alert-testing.mjs +80 -0
  2. package/fesm2022/ngx-com-components-alert-testing.mjs.map +1 -0
  3. package/fesm2022/ngx-com-components-calendar-testing.mjs +157 -0
  4. package/fesm2022/ngx-com-components-calendar-testing.mjs.map +1 -0
  5. package/fesm2022/ngx-com-components-carousel-testing.mjs +121 -0
  6. package/fesm2022/ngx-com-components-carousel-testing.mjs.map +1 -0
  7. package/fesm2022/ngx-com-components-checkbox-testing.mjs +113 -0
  8. package/fesm2022/ngx-com-components-checkbox-testing.mjs.map +1 -0
  9. package/fesm2022/ngx-com-components-code-block-testing.mjs +88 -0
  10. package/fesm2022/ngx-com-components-code-block-testing.mjs.map +1 -0
  11. package/fesm2022/ngx-com-components-collapsible-testing.mjs +104 -0
  12. package/fesm2022/ngx-com-components-collapsible-testing.mjs.map +1 -0
  13. package/fesm2022/ngx-com-components-confirm-testing.mjs +150 -0
  14. package/fesm2022/ngx-com-components-confirm-testing.mjs.map +1 -0
  15. package/fesm2022/ngx-com-components-datepicker-testing.mjs +137 -0
  16. package/fesm2022/ngx-com-components-datepicker-testing.mjs.map +1 -0
  17. package/fesm2022/ngx-com-components-dialog-testing.mjs +109 -0
  18. package/fesm2022/ngx-com-components-dialog-testing.mjs.map +1 -0
  19. package/fesm2022/ngx-com-components-dialog.mjs +18 -18
  20. package/fesm2022/ngx-com-components-dialog.mjs.map +1 -1
  21. package/fesm2022/ngx-com-components-dropdown.mjs +39 -0
  22. package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
  23. package/fesm2022/ngx-com-components-form-field-testing.mjs +140 -0
  24. package/fesm2022/ngx-com-components-form-field-testing.mjs.map +1 -0
  25. package/fesm2022/ngx-com-components-form-field.mjs +5 -1
  26. package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
  27. package/fesm2022/ngx-com-components-menu-testing.mjs +298 -0
  28. package/fesm2022/ngx-com-components-menu-testing.mjs.map +1 -0
  29. package/fesm2022/ngx-com-components-paginator-testing.mjs +128 -0
  30. package/fesm2022/ngx-com-components-paginator-testing.mjs.map +1 -0
  31. package/fesm2022/ngx-com-components-popover-testing.mjs +115 -0
  32. package/fesm2022/ngx-com-components-popover-testing.mjs.map +1 -0
  33. package/fesm2022/ngx-com-components-radio-testing.mjs +157 -0
  34. package/fesm2022/ngx-com-components-radio-testing.mjs.map +1 -0
  35. package/fesm2022/ngx-com-components-segmented-control-testing.mjs +122 -0
  36. package/fesm2022/ngx-com-components-segmented-control-testing.mjs.map +1 -0
  37. package/fesm2022/ngx-com-components-sort-testing.mjs +108 -0
  38. package/fesm2022/ngx-com-components-sort-testing.mjs.map +1 -0
  39. package/fesm2022/ngx-com-components-switch-testing.mjs +103 -0
  40. package/fesm2022/ngx-com-components-switch-testing.mjs.map +1 -0
  41. package/fesm2022/ngx-com-components-table-testing.mjs +198 -0
  42. package/fesm2022/ngx-com-components-table-testing.mjs.map +1 -0
  43. package/fesm2022/ngx-com-components-tabs-testing.mjs +126 -0
  44. package/fesm2022/ngx-com-components-tabs-testing.mjs.map +1 -0
  45. package/fesm2022/ngx-com-components-timepicker-testing.mjs +117 -0
  46. package/fesm2022/ngx-com-components-timepicker-testing.mjs.map +1 -0
  47. package/fesm2022/ngx-com-components-toast-testing.mjs +172 -0
  48. package/fesm2022/ngx-com-components-toast-testing.mjs.map +1 -0
  49. package/fesm2022/ngx-com-components-toast.mjs +4 -4
  50. package/fesm2022/ngx-com-components-toast.mjs.map +1 -1
  51. package/fesm2022/ngx-com-components-tooltip-testing.mjs +117 -0
  52. package/fesm2022/ngx-com-components-tooltip-testing.mjs.map +1 -0
  53. package/package.json +89 -1
  54. package/types/ngx-com-components-alert-testing.d.ts +41 -0
  55. package/types/ngx-com-components-calendar-testing.d.ts +80 -0
  56. package/types/ngx-com-components-carousel-testing.d.ts +51 -0
  57. package/types/ngx-com-components-checkbox-testing.d.ts +56 -0
  58. package/types/ngx-com-components-code-block-testing.d.ts +45 -0
  59. package/types/ngx-com-components-collapsible-testing.d.ts +53 -0
  60. package/types/ngx-com-components-confirm-testing.d.ts +78 -0
  61. package/types/ngx-com-components-datepicker-testing.d.ts +61 -0
  62. package/types/ngx-com-components-dialog-testing.d.ts +57 -0
  63. package/types/ngx-com-components-dropdown.d.ts +12 -0
  64. package/types/ngx-com-components-form-field-testing.d.ts +61 -0
  65. package/types/ngx-com-components-menu-testing.d.ts +167 -0
  66. package/types/ngx-com-components-paginator-testing.d.ts +58 -0
  67. package/types/ngx-com-components-popover-testing.d.ts +63 -0
  68. package/types/ngx-com-components-radio-testing.d.ts +86 -0
  69. package/types/ngx-com-components-segmented-control-testing.d.ts +66 -0
  70. package/types/ngx-com-components-sort-testing.d.ts +62 -0
  71. package/types/ngx-com-components-switch-testing.d.ts +52 -0
  72. package/types/ngx-com-components-table-testing.d.ts +124 -0
  73. package/types/ngx-com-components-tabs-testing.d.ts +67 -0
  74. package/types/ngx-com-components-timepicker-testing.d.ts +53 -0
  75. package/types/ngx-com-components-toast-testing.d.ts +93 -0
  76. package/types/ngx-com-components-tooltip-testing.d.ts +57 -0
@@ -0,0 +1,61 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, TestElement } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComDatepickerHarness. */
4
+ interface ComDatepickerHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the datepicker's placeholder text. */
6
+ placeholder?: string | RegExp;
7
+ /** Filter by whether the datepicker is disabled. */
8
+ disabled?: boolean;
9
+ /** Filter by whether the datepicker panel is open. */
10
+ open?: boolean;
11
+ }
12
+ /**
13
+ * Harness for interacting with a ComDatepicker in tests.
14
+ */
15
+ declare class ComDatepickerHarness extends ComponentHarness {
16
+ static hostSelector: string;
17
+ private readonly triggerGroup;
18
+ private readonly input;
19
+ private readonly clearButton;
20
+ private readonly calendarButton;
21
+ /**
22
+ * Gets a HarnessPredicate for matching datepickers.
23
+ * @param options Filter options.
24
+ */
25
+ static with(options?: ComDatepickerHarnessFilters): HarnessPredicate<ComDatepickerHarness>;
26
+ /** Whether the datepicker panel is currently open. */
27
+ isOpen(): Promise<boolean>;
28
+ /** Opens the datepicker panel if it is closed. */
29
+ open(): Promise<void>;
30
+ /** Closes the datepicker panel if it is open. */
31
+ close(): Promise<void>;
32
+ /** Whether the datepicker is disabled. */
33
+ isDisabled(): Promise<boolean>;
34
+ /** Whether the datepicker input has the required attribute. */
35
+ isRequired(): Promise<boolean>;
36
+ /** Whether the datepicker input is in an invalid state. */
37
+ isInvalid(): Promise<boolean>;
38
+ /** Gets the current value displayed in the input. */
39
+ getInputValue(): Promise<string>;
40
+ /** Sets the input value by clearing and typing the given text. */
41
+ setInputValue(text: string): Promise<void>;
42
+ /** Gets the placeholder text of the input. */
43
+ getPlaceholder(): Promise<string>;
44
+ /** Whether the datepicker currently has a value (clear button is visible). */
45
+ hasValue(): Promise<boolean>;
46
+ /** Clears the current value by clicking the clear button. Throws if no value is set. */
47
+ clear(): Promise<void>;
48
+ /** Gets the calendar panel element from the overlay. The datepicker must be open. */
49
+ getCalendarPanel(): Promise<TestElement>;
50
+ /** Selects a day by its visible number. Opens the panel if closed. */
51
+ selectDate(day: number): Promise<void>;
52
+ /** Focuses the datepicker input. */
53
+ focus(): Promise<void>;
54
+ /** Blurs the datepicker input. */
55
+ blur(): Promise<void>;
56
+ /** Whether the datepicker input is currently focused. */
57
+ isFocused(): Promise<boolean>;
58
+ }
59
+
60
+ export { ComDatepickerHarness };
61
+ export type { ComDatepickerHarnessFilters };
@@ -0,0 +1,57 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComDialogContainerHarness. */
4
+ type ComDialogContainerHarnessFilters = BaseHarnessFilters;
5
+ /**
6
+ * Harness for interacting with a dialog container in tests.
7
+ *
8
+ * Because dialogs render inside a CDK overlay (outside the component tree),
9
+ * obtain this harness via `TestbedHarnessEnvironment.documentRootLoader(fixture)`.
10
+ */
11
+ declare class ComDialogContainerHarness extends ComponentHarness {
12
+ static hostSelector: string;
13
+ private readonly panel;
14
+ private readonly titleEl;
15
+ private readonly contentEl;
16
+ private readonly actionsEl;
17
+ private readonly closeButton;
18
+ /**
19
+ * Gets a HarnessPredicate for matching dialog containers.
20
+ * @param options Filter options.
21
+ */
22
+ static with(options?: ComDialogContainerHarnessFilters): HarnessPredicate<ComDialogContainerHarness>;
23
+ /** Gets the dialog panel's `aria-label` attribute. */
24
+ getAriaLabel(): Promise<string | null>;
25
+ /** Gets the dialog panel's `aria-labelledby` attribute. */
26
+ getAriaLabelledby(): Promise<string | null>;
27
+ /** Gets the dialog panel's `aria-describedby` attribute. */
28
+ getAriaDescribedby(): Promise<string | null>;
29
+ /** Gets the role attribute on the dialog panel. */
30
+ getRole(): Promise<string | null>;
31
+ /** Gets the text content of the `[comDialogTitle]` element, or null if none exists. */
32
+ getTitleText(): Promise<string | null>;
33
+ /** Gets the text content of the `[comDialogContent]` element, or null if none exists. */
34
+ getContentText(): Promise<string | null>;
35
+ /** Gets the text content of the `[comDialogActions]` element, or null if none exists. */
36
+ getActionsText(): Promise<string | null>;
37
+ /** Gets the `data-state` attribute on the dialog panel. */
38
+ getState(): Promise<string | null>;
39
+ /**
40
+ * Closes the dialog by clicking the `[comDialogClose]` button.
41
+ * Throws if no close button is found.
42
+ */
43
+ close(): Promise<void>;
44
+ /** Sends an Escape key press to the dialog panel to close it. */
45
+ sendEscapeKey(): Promise<void>;
46
+ /** Whether the dialog container is disabled. */
47
+ isDisabled(): Promise<boolean>;
48
+ /** Whether the dialog panel is focused. */
49
+ isFocused(): Promise<boolean>;
50
+ /** Focuses the dialog panel. */
51
+ focus(): Promise<void>;
52
+ /** Blurs the dialog panel. */
53
+ blur(): Promise<void>;
54
+ }
55
+
56
+ export { ComDialogContainerHarness };
57
+ export type { ComDialogContainerHarnessFilters };
@@ -602,6 +602,8 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
602
602
  private scrollSubscription;
603
603
  /** Throttled handler for standard scroll events. */
604
604
  private throttledScrollHandler;
605
+ /** Cleanup functions for ancestor scroll listeners. */
606
+ private ancestorScrollCleanups;
605
607
  /** IDs for aria-describedby (set by form-field). */
606
608
  private readonly _describedByIds;
607
609
  /** Form field appearance (set by form-field). */
@@ -732,6 +734,16 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
732
734
  private flattenGroupedOptions;
733
735
  private typeAhead;
734
736
  private announce;
737
+ /**
738
+ * Listens for scroll events on ancestor elements of the trigger.
739
+ * Closes the dropdown when the page scrolls, since CDK's reposition strategy
740
+ * only detects window scroll and registered cdkScrollable elements — not
741
+ * arbitrary scrollable containers (common in SPAs).
742
+ * SSR-safe: only called from user interaction handlers.
743
+ */
744
+ private setupAncestorScrollListeners;
745
+ /** Removes ancestor scroll listeners. */
746
+ private cleanupAncestorScrollListeners;
735
747
  /** Sets up scroll detection for the loadMore output. SSR-safe: only called from user interaction. */
736
748
  private setupScrollDetection;
737
749
  /** Cleans up scroll detection listeners. */
@@ -0,0 +1,61 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, TestElement } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComFormFieldHarness. */
4
+ interface ComFormFieldHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the form field's label text. */
6
+ label?: string | RegExp;
7
+ /** Filter by whether the form field has errors. */
8
+ hasErrors?: boolean;
9
+ /** Filter by whether the form field is disabled. */
10
+ disabled?: boolean;
11
+ /** Filter by whether the label is floating. */
12
+ floatingLabel?: boolean;
13
+ }
14
+ /**
15
+ * Harness for interacting with a ComFormField in tests.
16
+ */
17
+ declare class ComFormFieldHarness extends ComponentHarness {
18
+ static hostSelector: string;
19
+ private readonly label;
20
+ private readonly input;
21
+ private readonly hints;
22
+ private readonly errors;
23
+ private readonly prefix;
24
+ private readonly suffix;
25
+ /**
26
+ * Gets a HarnessPredicate for matching form fields.
27
+ * @param options Filter options.
28
+ */
29
+ static with(options?: ComFormFieldHarnessFilters): HarnessPredicate<ComFormFieldHarness>;
30
+ /** Gets the form field's label text, or null if no label is present. */
31
+ getLabel(): Promise<string | null>;
32
+ /** Whether the form field has a label. */
33
+ hasLabel(): Promise<boolean>;
34
+ /** Whether the form field is disabled. */
35
+ isDisabled(): Promise<boolean>;
36
+ /** Whether the form field is focused. */
37
+ isFocused(): Promise<boolean>;
38
+ /** Whether the form field has errors. */
39
+ hasErrors(): Promise<boolean>;
40
+ /** Whether the label is currently floating. */
41
+ isLabelFloating(): Promise<boolean>;
42
+ /** Gets the text content of all visible error elements. */
43
+ getTextErrors(): Promise<string[]>;
44
+ /** Gets the text content of all hint elements. */
45
+ getTextHints(): Promise<string[]>;
46
+ /** Whether the form field has a prefix element. */
47
+ hasPrefix(): Promise<boolean>;
48
+ /** Whether the form field has a suffix element. */
49
+ hasSuffix(): Promise<boolean>;
50
+ /** Whether the form field's control is required. */
51
+ isRequired(): Promise<boolean>;
52
+ /** Gets the form field's inner control element (input or textarea). */
53
+ getControl(): Promise<TestElement | null>;
54
+ /** Focuses the form field's inner control element. */
55
+ focus(): Promise<void>;
56
+ /** Blurs the form field's inner control element. */
57
+ blur(): Promise<void>;
58
+ }
59
+
60
+ export { ComFormFieldHarness };
61
+ export type { ComFormFieldHarnessFilters };
@@ -0,0 +1,167 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, TestKey } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComMenuItemHarness. */
4
+ interface ComMenuItemHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the item's text content. */
6
+ text?: string | RegExp;
7
+ /** Filter by whether the item is disabled. */
8
+ disabled?: boolean;
9
+ }
10
+ /** Harness filters for ComMenuItemCheckboxHarness. */
11
+ interface ComMenuItemCheckboxHarnessFilters extends BaseHarnessFilters {
12
+ /** Filter by the item's text content. */
13
+ text?: string | RegExp;
14
+ /** Filter by whether the item is disabled. */
15
+ disabled?: boolean;
16
+ /** Filter by whether the item is checked. */
17
+ checked?: boolean;
18
+ }
19
+ /** Harness filters for ComMenuItemRadioHarness. */
20
+ interface ComMenuItemRadioHarnessFilters extends BaseHarnessFilters {
21
+ /** Filter by the item's text content. */
22
+ text?: string | RegExp;
23
+ /** Filter by whether the item is disabled. */
24
+ disabled?: boolean;
25
+ /** Filter by whether the item is checked. */
26
+ checked?: boolean;
27
+ }
28
+ /** Harness filters for ComMenuHarness. */
29
+ interface ComMenuHarnessFilters extends BaseHarnessFilters {
30
+ /** Filter by the menu's aria-label. */
31
+ ariaLabel?: string | RegExp;
32
+ }
33
+ /** Harness filters for ComMenuTriggerHarness. */
34
+ interface ComMenuTriggerHarnessFilters extends BaseHarnessFilters {
35
+ /** Filter by the trigger element's text. */
36
+ text?: string | RegExp;
37
+ }
38
+ /**
39
+ * Harness for interacting with a menu item in tests.
40
+ */
41
+ declare class ComMenuItemHarness extends ComponentHarness {
42
+ static hostSelector: string;
43
+ /**
44
+ * Gets a HarnessPredicate for matching menu items.
45
+ * @param options Filter options.
46
+ */
47
+ static with(options?: ComMenuItemHarnessFilters): HarnessPredicate<ComMenuItemHarness>;
48
+ /** Gets the item's text content. */
49
+ getText(): Promise<string>;
50
+ /** Whether the item is disabled. */
51
+ isDisabled(): Promise<boolean>;
52
+ /** Clicks the menu item. */
53
+ click(): Promise<void>;
54
+ /** Focuses the menu item. */
55
+ focus(): Promise<void>;
56
+ /** Whether the menu item is focused. */
57
+ isFocused(): Promise<boolean>;
58
+ }
59
+ /**
60
+ * Harness for interacting with a checkbox menu item in tests.
61
+ */
62
+ declare class ComMenuItemCheckboxHarness extends ComponentHarness {
63
+ static hostSelector: string;
64
+ /**
65
+ * Gets a HarnessPredicate for matching checkbox menu items.
66
+ * @param options Filter options.
67
+ */
68
+ static with(options?: ComMenuItemCheckboxHarnessFilters): HarnessPredicate<ComMenuItemCheckboxHarness>;
69
+ /** Gets the item's text content. */
70
+ getText(): Promise<string>;
71
+ /** Whether the item is disabled. */
72
+ isDisabled(): Promise<boolean>;
73
+ /** Whether the item is checked. */
74
+ isChecked(): Promise<boolean>;
75
+ /** Toggles the checkbox item by clicking it. */
76
+ toggle(): Promise<void>;
77
+ /** Focuses the item. */
78
+ focus(): Promise<void>;
79
+ /** Whether the item is focused. */
80
+ isFocused(): Promise<boolean>;
81
+ }
82
+ /**
83
+ * Harness for interacting with a radio menu item in tests.
84
+ */
85
+ declare class ComMenuItemRadioHarness extends ComponentHarness {
86
+ static hostSelector: string;
87
+ /**
88
+ * Gets a HarnessPredicate for matching radio menu items.
89
+ * @param options Filter options.
90
+ */
91
+ static with(options?: ComMenuItemRadioHarnessFilters): HarnessPredicate<ComMenuItemRadioHarness>;
92
+ /** Gets the item's text content. */
93
+ getText(): Promise<string>;
94
+ /** Whether the item is disabled. */
95
+ isDisabled(): Promise<boolean>;
96
+ /** Whether the item is checked. */
97
+ isChecked(): Promise<boolean>;
98
+ /** Clicks the radio item. */
99
+ click(): Promise<void>;
100
+ /** Focuses the item. */
101
+ focus(): Promise<void>;
102
+ /** Whether the item is focused. */
103
+ isFocused(): Promise<boolean>;
104
+ }
105
+ /**
106
+ * Harness for interacting with a com-menu panel in tests.
107
+ */
108
+ declare class ComMenuHarness extends ComponentHarness {
109
+ static hostSelector: string;
110
+ private readonly menuPanel;
111
+ /**
112
+ * Gets a HarnessPredicate for matching menus.
113
+ * @param options Filter options.
114
+ */
115
+ static with(options?: ComMenuHarnessFilters): HarnessPredicate<ComMenuHarness>;
116
+ /** Gets the menu's aria-label. */
117
+ getAriaLabel(): Promise<string | null>;
118
+ /** Gets the menu panel's ID. */
119
+ getMenuId(): Promise<string | null>;
120
+ /** Gets all menu items, optionally filtered. */
121
+ getItems(filters?: ComMenuItemHarnessFilters): Promise<ComMenuItemHarness[]>;
122
+ /** Gets all checkbox menu items, optionally filtered. */
123
+ getCheckboxItems(filters?: ComMenuItemCheckboxHarnessFilters): Promise<ComMenuItemCheckboxHarness[]>;
124
+ /** Gets all radio menu items, optionally filtered. */
125
+ getRadioItems(filters?: ComMenuItemRadioHarnessFilters): Promise<ComMenuItemRadioHarness[]>;
126
+ /** Gets all menu item texts. */
127
+ getItemLabels(): Promise<string[]>;
128
+ }
129
+ /**
130
+ * Harness for interacting with a menu trigger in tests.
131
+ */
132
+ declare class ComMenuTriggerHarness extends ComponentHarness {
133
+ static hostSelector: string;
134
+ private readonly documentRootLocator;
135
+ /**
136
+ * Gets a HarnessPredicate for matching menu triggers.
137
+ * @param options Filter options.
138
+ */
139
+ static with(options?: ComMenuTriggerHarnessFilters): HarnessPredicate<ComMenuTriggerHarness>;
140
+ /** Gets the trigger element's text. */
141
+ getText(): Promise<string>;
142
+ /** Whether the menu is currently open. */
143
+ isOpen(): Promise<boolean>;
144
+ /** Opens the menu if it's closed. */
145
+ open(): Promise<void>;
146
+ /** Closes the menu if it's open. */
147
+ close(): Promise<void>;
148
+ /** Toggles the menu open/close state. */
149
+ toggle(): Promise<void>;
150
+ /** Gets the menu panel harness, or null if the menu is closed. */
151
+ getMenu(): Promise<ComMenuHarness | null>;
152
+ /** Opens the menu and gets all menu items. */
153
+ getItems(filters?: ComMenuItemHarnessFilters): Promise<ComMenuItemHarness[]>;
154
+ /** Opens the menu, finds an item by filter, and clicks it. */
155
+ clickItem(filter: ComMenuItemHarnessFilters): Promise<void>;
156
+ /** Sends keyboard input to the trigger element. */
157
+ sendKeys(...keys: (string | TestKey)[]): Promise<void>;
158
+ /** Focuses the trigger element. */
159
+ focus(): Promise<void>;
160
+ /** Blurs the trigger element. */
161
+ blur(): Promise<void>;
162
+ /** Whether the trigger element is focused. */
163
+ isFocused(): Promise<boolean>;
164
+ }
165
+
166
+ export { ComMenuHarness, ComMenuItemCheckboxHarness, ComMenuItemHarness, ComMenuItemRadioHarness, ComMenuTriggerHarness };
167
+ export type { ComMenuHarnessFilters, ComMenuItemCheckboxHarnessFilters, ComMenuItemHarnessFilters, ComMenuItemRadioHarnessFilters, ComMenuTriggerHarnessFilters };
@@ -0,0 +1,58 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComPaginatorHarness. */
4
+ interface ComPaginatorHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by whether the paginator is disabled. */
6
+ disabled?: boolean;
7
+ }
8
+ /**
9
+ * Harness for interacting with a ComPaginator in tests.
10
+ */
11
+ declare class ComPaginatorHarness extends ComponentHarness {
12
+ static hostSelector: string;
13
+ private readonly previousButton;
14
+ private readonly nextButton;
15
+ private readonly firstButton;
16
+ private readonly lastButton;
17
+ private readonly rangeLabel;
18
+ private readonly select;
19
+ private readonly nav;
20
+ /**
21
+ * Gets a HarnessPredicate for matching paginators.
22
+ * @param options Filter options.
23
+ */
24
+ static with(options?: ComPaginatorHarnessFilters): HarnessPredicate<ComPaginatorHarness>;
25
+ /** Navigates to the first page. Throws if the first page button is not present. */
26
+ goToFirstPage(): Promise<void>;
27
+ /** Navigates to the previous page. */
28
+ goToPreviousPage(): Promise<void>;
29
+ /** Navigates to the next page. */
30
+ goToNextPage(): Promise<void>;
31
+ /** Navigates to the last page. Throws if the last page button is not present. */
32
+ goToLastPage(): Promise<void>;
33
+ /** Navigates to a specific page (1-based). Throws if page button is not present. */
34
+ goToPage(pageNumber: number): Promise<void>;
35
+ /** Gets the range label text. */
36
+ getRangeLabel(): Promise<string>;
37
+ /** Gets the current page size from the select element. Throws if no select is present. */
38
+ getPageSize(): Promise<number>;
39
+ /** Sets the page size by selecting a value. Throws if no select is present. */
40
+ setPageSize(size: number): Promise<void>;
41
+ /** Whether the previous page button is disabled. */
42
+ isPreviousPageDisabled(): Promise<boolean>;
43
+ /** Whether the next page button is disabled. */
44
+ isNextPageDisabled(): Promise<boolean>;
45
+ /** Whether the paginator is fully disabled (both prev and next buttons disabled). */
46
+ isDisabled(): Promise<boolean>;
47
+ /** Gets the aria-label of the navigation element. */
48
+ getAriaLabel(): Promise<string | null>;
49
+ /** Whether the paginator navigation is focused. */
50
+ isFocused(): Promise<boolean>;
51
+ /** Focuses the paginator host element. */
52
+ focus(): Promise<void>;
53
+ /** Blurs the paginator host element. */
54
+ blur(): Promise<void>;
55
+ }
56
+
57
+ export { ComPaginatorHarness };
58
+ export type { ComPaginatorHarnessFilters };
@@ -0,0 +1,63 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComPopoverContentHarness. */
4
+ type ComPopoverContentHarnessFilters = BaseHarnessFilters;
5
+ /** Harness filters for ComPopoverTriggerHarness. */
6
+ interface ComPopoverTriggerHarnessFilters extends BaseHarnessFilters {
7
+ /** Filter by the trigger element's text. */
8
+ text?: string | RegExp;
9
+ }
10
+ /**
11
+ * Harness for interacting with popover content in tests.
12
+ * This harness targets the `com-popover-content` element rendered in the overlay.
13
+ */
14
+ declare class ComPopoverContentHarness extends ComponentHarness {
15
+ static hostSelector: string;
16
+ private readonly dialogPanel;
17
+ /**
18
+ * Gets a HarnessPredicate for matching popover content.
19
+ * @param options Filter options.
20
+ */
21
+ static with(options?: ComPopoverContentHarnessFilters): HarnessPredicate<ComPopoverContentHarness>;
22
+ /** Gets the popover dialog panel's aria-label. */
23
+ getAriaLabel(): Promise<string | null>;
24
+ /** Gets the text content of the popover dialog panel. */
25
+ getText(): Promise<string>;
26
+ /** Gets the `data-side` attribute from the popover wrapper. */
27
+ getSide(): Promise<string | null>;
28
+ /** Gets the `data-state` attribute from the popover wrapper. */
29
+ getState(): Promise<string | null>;
30
+ }
31
+ /**
32
+ * Harness for interacting with a popover trigger in tests.
33
+ */
34
+ declare class ComPopoverTriggerHarness extends ComponentHarness {
35
+ static hostSelector: string;
36
+ private readonly documentRootLocator;
37
+ /**
38
+ * Gets a HarnessPredicate for matching popover triggers.
39
+ * @param options Filter options.
40
+ */
41
+ static with(options?: ComPopoverTriggerHarnessFilters): HarnessPredicate<ComPopoverTriggerHarness>;
42
+ /** Gets the trigger element's text. */
43
+ getText(): Promise<string>;
44
+ /** Whether the popover is currently open. */
45
+ isOpen(): Promise<boolean>;
46
+ /** Opens the popover if it's closed. */
47
+ open(): Promise<void>;
48
+ /** Closes the popover if it's open. */
49
+ close(): Promise<void>;
50
+ /** Toggles the popover open/close state by clicking the trigger. */
51
+ toggle(): Promise<void>;
52
+ /** Gets the popover content harness, or null if the popover is closed. */
53
+ getPopoverContent(): Promise<ComPopoverContentHarness | null>;
54
+ /** Focuses the trigger element. */
55
+ focus(): Promise<void>;
56
+ /** Blurs the trigger element. */
57
+ blur(): Promise<void>;
58
+ /** Whether the trigger element is focused. */
59
+ isFocused(): Promise<boolean>;
60
+ }
61
+
62
+ export { ComPopoverContentHarness, ComPopoverTriggerHarness };
63
+ export type { ComPopoverContentHarnessFilters, ComPopoverTriggerHarnessFilters };
@@ -0,0 +1,86 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComRadioButtonHarness. */
4
+ interface ComRadioButtonHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the radio button's label text. */
6
+ label?: string | RegExp;
7
+ /** Filter by the radio button's value. */
8
+ value?: string | RegExp;
9
+ /** Filter by whether the radio button is disabled. */
10
+ disabled?: boolean;
11
+ /** Filter by whether the radio button is checked. */
12
+ checked?: boolean;
13
+ }
14
+ /** Harness filters for ComRadioGroupHarness. */
15
+ interface ComRadioGroupHarnessFilters extends BaseHarnessFilters {
16
+ /** Filter by the radio group's name. */
17
+ name?: string | RegExp;
18
+ /** Filter by whether the radio group is disabled. */
19
+ disabled?: boolean;
20
+ }
21
+ /**
22
+ * Harness for interacting with a radio button in tests.
23
+ */
24
+ declare class ComRadioButtonHarness extends ComponentHarness {
25
+ static hostSelector: string;
26
+ private readonly label;
27
+ private readonly input;
28
+ private readonly labelText;
29
+ /**
30
+ * Gets a HarnessPredicate for matching radio buttons.
31
+ * @param options Filter options.
32
+ */
33
+ static with(options?: ComRadioButtonHarnessFilters): HarnessPredicate<ComRadioButtonHarness>;
34
+ /** Whether the radio button is checked. */
35
+ isChecked(): Promise<boolean>;
36
+ /** Whether the radio button is disabled. */
37
+ isDisabled(): Promise<boolean>;
38
+ /** Gets the radio button's label text. */
39
+ getLabelText(): Promise<string>;
40
+ /** Gets the radio button's value. */
41
+ getValue(): Promise<string>;
42
+ /** Checks the radio button if it is not already checked. */
43
+ check(): Promise<void>;
44
+ /** Focuses the radio button's input. */
45
+ focus(): Promise<void>;
46
+ /** Blurs the radio button's input. */
47
+ blur(): Promise<void>;
48
+ /** Whether the radio button's input is focused. */
49
+ isFocused(): Promise<boolean>;
50
+ }
51
+ /**
52
+ * Harness for interacting with a radio group in tests.
53
+ */
54
+ declare class ComRadioGroupHarness extends ComponentHarness {
55
+ static hostSelector: string;
56
+ private readonly radioGroup;
57
+ private readonly errorMessage;
58
+ /**
59
+ * Gets a HarnessPredicate for matching radio groups.
60
+ * @param options Filter options.
61
+ */
62
+ static with(options?: ComRadioGroupHarnessFilters): HarnessPredicate<ComRadioGroupHarness>;
63
+ /** Gets all radio buttons in the group, optionally filtered. */
64
+ getRadioButtons(filters?: ComRadioButtonHarnessFilters): Promise<ComRadioButtonHarness[]>;
65
+ /** Gets the checked radio button, or null if none is checked. */
66
+ getCheckedRadioButton(): Promise<ComRadioButtonHarness | null>;
67
+ /** Gets the value of the checked radio button, or null if none is checked. */
68
+ getCheckedValue(): Promise<string | null>;
69
+ /** Gets the name attribute of the radio group from the first radio input. */
70
+ getName(): Promise<string | null>;
71
+ /** Whether the radio group is disabled. */
72
+ isDisabled(): Promise<boolean>;
73
+ /** Whether the radio group is required. */
74
+ isRequired(): Promise<boolean>;
75
+ /** Whether the radio group has an error state. */
76
+ hasError(): Promise<boolean>;
77
+ /** Gets the error message text, or null if no error is displayed. */
78
+ getErrorMessage(): Promise<string | null>;
79
+ /** Gets the aria-label of the radio group. */
80
+ getAriaLabel(): Promise<string | null>;
81
+ /** Checks a radio button matching the given filter. */
82
+ checkRadioButton(filter?: ComRadioButtonHarnessFilters): Promise<void>;
83
+ }
84
+
85
+ export { ComRadioButtonHarness, ComRadioGroupHarness };
86
+ export type { ComRadioButtonHarnessFilters, ComRadioGroupHarnessFilters };
@@ -0,0 +1,66 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComSegmentHarness. */
4
+ interface ComSegmentHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the segment's label text. */
6
+ label?: string | RegExp;
7
+ /** Filter by whether the segment is selected. */
8
+ selected?: boolean;
9
+ /** Filter by whether the segment is disabled. */
10
+ disabled?: boolean;
11
+ }
12
+ /** Harness filters for ComSegmentedControlHarness. */
13
+ interface ComSegmentedControlHarnessFilters extends BaseHarnessFilters {
14
+ /** Filter by the control's aria-label. */
15
+ ariaLabel?: string | RegExp;
16
+ }
17
+ /**
18
+ * Harness for interacting with an individual segment button in tests.
19
+ */
20
+ declare class ComSegmentHarness extends ComponentHarness {
21
+ static hostSelector: string;
22
+ /**
23
+ * Gets a HarnessPredicate for matching segments.
24
+ * @param options Filter options.
25
+ */
26
+ static with(options?: ComSegmentHarnessFilters): HarnessPredicate<ComSegmentHarness>;
27
+ /** Gets the segment's label text. Uses aria-label if present, otherwise text content. */
28
+ getLabel(): Promise<string>;
29
+ /** Whether the segment is currently selected. */
30
+ isSelected(): Promise<boolean>;
31
+ /** Whether the segment is disabled. */
32
+ isDisabled(): Promise<boolean>;
33
+ /** Clicks the segment to select it. Throws if disabled. */
34
+ select(): Promise<void>;
35
+ /** Focuses the segment button. */
36
+ focus(): Promise<void>;
37
+ /** Blurs the segment button. */
38
+ blur(): Promise<void>;
39
+ /** Whether the segment button is focused. */
40
+ isFocused(): Promise<boolean>;
41
+ }
42
+ /**
43
+ * Harness for interacting with a ComSegmentedControl in tests.
44
+ */
45
+ declare class ComSegmentedControlHarness extends ComponentHarness {
46
+ static hostSelector: string;
47
+ private readonly radioGroup;
48
+ /**
49
+ * Gets a HarnessPredicate for matching segmented controls.
50
+ * @param options Filter options.
51
+ */
52
+ static with(options?: ComSegmentedControlHarnessFilters): HarnessPredicate<ComSegmentedControlHarness>;
53
+ /** Gets all segment buttons, optionally filtered. */
54
+ getSegments(filters?: ComSegmentHarnessFilters): Promise<ComSegmentHarness[]>;
55
+ /** Gets the currently selected segment, or null if none is selected. */
56
+ getSelectedSegment(): Promise<ComSegmentHarness | null>;
57
+ /** Selects a segment matching the given filter. */
58
+ selectSegment(filter: ComSegmentHarnessFilters): Promise<void>;
59
+ /** Gets all segment label texts. */
60
+ getSegmentLabels(): Promise<string[]>;
61
+ /** Gets the radiogroup's aria-label. */
62
+ getAriaLabel(): Promise<string | null>;
63
+ }
64
+
65
+ export { ComSegmentHarness, ComSegmentedControlHarness };
66
+ export type { ComSegmentHarnessFilters, ComSegmentedControlHarnessFilters };