ngx-com 0.1.16 → 0.1.18

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 (82) 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-checkbox.mjs +2 -2
  10. package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
  11. package/fesm2022/ngx-com-components-code-block-testing.mjs +88 -0
  12. package/fesm2022/ngx-com-components-code-block-testing.mjs.map +1 -0
  13. package/fesm2022/ngx-com-components-collapsible-testing.mjs +104 -0
  14. package/fesm2022/ngx-com-components-collapsible-testing.mjs.map +1 -0
  15. package/fesm2022/ngx-com-components-confirm-testing.mjs +150 -0
  16. package/fesm2022/ngx-com-components-confirm-testing.mjs.map +1 -0
  17. package/fesm2022/ngx-com-components-datepicker-testing.mjs +137 -0
  18. package/fesm2022/ngx-com-components-datepicker-testing.mjs.map +1 -0
  19. package/fesm2022/ngx-com-components-dialog-testing.mjs +109 -0
  20. package/fesm2022/ngx-com-components-dialog-testing.mjs.map +1 -0
  21. package/fesm2022/ngx-com-components-dialog.mjs +18 -18
  22. package/fesm2022/ngx-com-components-dialog.mjs.map +1 -1
  23. package/fesm2022/ngx-com-components-dropdown.mjs +39 -0
  24. package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
  25. package/fesm2022/ngx-com-components-form-field-testing.mjs +140 -0
  26. package/fesm2022/ngx-com-components-form-field-testing.mjs.map +1 -0
  27. package/fesm2022/ngx-com-components-form-field.mjs +5 -1
  28. package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
  29. package/fesm2022/ngx-com-components-menu-testing.mjs +298 -0
  30. package/fesm2022/ngx-com-components-menu-testing.mjs.map +1 -0
  31. package/fesm2022/ngx-com-components-paginator-testing.mjs +128 -0
  32. package/fesm2022/ngx-com-components-paginator-testing.mjs.map +1 -0
  33. package/fesm2022/ngx-com-components-popover-testing.mjs +115 -0
  34. package/fesm2022/ngx-com-components-popover-testing.mjs.map +1 -0
  35. package/fesm2022/ngx-com-components-radio-testing.mjs +157 -0
  36. package/fesm2022/ngx-com-components-radio-testing.mjs.map +1 -0
  37. package/fesm2022/ngx-com-components-radio.mjs +2 -2
  38. package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
  39. package/fesm2022/ngx-com-components-segmented-control-testing.mjs +122 -0
  40. package/fesm2022/ngx-com-components-segmented-control-testing.mjs.map +1 -0
  41. package/fesm2022/ngx-com-components-sort-testing.mjs +108 -0
  42. package/fesm2022/ngx-com-components-sort-testing.mjs.map +1 -0
  43. package/fesm2022/ngx-com-components-switch-testing.mjs +103 -0
  44. package/fesm2022/ngx-com-components-switch-testing.mjs.map +1 -0
  45. package/fesm2022/ngx-com-components-switch.mjs +2 -2
  46. package/fesm2022/ngx-com-components-switch.mjs.map +1 -1
  47. package/fesm2022/ngx-com-components-table-testing.mjs +198 -0
  48. package/fesm2022/ngx-com-components-table-testing.mjs.map +1 -0
  49. package/fesm2022/ngx-com-components-tabs-testing.mjs +126 -0
  50. package/fesm2022/ngx-com-components-tabs-testing.mjs.map +1 -0
  51. package/fesm2022/ngx-com-components-timepicker-testing.mjs +117 -0
  52. package/fesm2022/ngx-com-components-timepicker-testing.mjs.map +1 -0
  53. package/fesm2022/ngx-com-components-toast-testing.mjs +172 -0
  54. package/fesm2022/ngx-com-components-toast-testing.mjs.map +1 -0
  55. package/fesm2022/ngx-com-components-toast.mjs +4 -4
  56. package/fesm2022/ngx-com-components-toast.mjs.map +1 -1
  57. package/fesm2022/ngx-com-components-tooltip-testing.mjs +117 -0
  58. package/fesm2022/ngx-com-components-tooltip-testing.mjs.map +1 -0
  59. package/package.json +89 -1
  60. package/types/ngx-com-components-alert-testing.d.ts +41 -0
  61. package/types/ngx-com-components-calendar-testing.d.ts +80 -0
  62. package/types/ngx-com-components-carousel-testing.d.ts +51 -0
  63. package/types/ngx-com-components-checkbox-testing.d.ts +56 -0
  64. package/types/ngx-com-components-code-block-testing.d.ts +45 -0
  65. package/types/ngx-com-components-collapsible-testing.d.ts +53 -0
  66. package/types/ngx-com-components-confirm-testing.d.ts +78 -0
  67. package/types/ngx-com-components-datepicker-testing.d.ts +61 -0
  68. package/types/ngx-com-components-dialog-testing.d.ts +57 -0
  69. package/types/ngx-com-components-dropdown.d.ts +12 -0
  70. package/types/ngx-com-components-form-field-testing.d.ts +61 -0
  71. package/types/ngx-com-components-menu-testing.d.ts +167 -0
  72. package/types/ngx-com-components-paginator-testing.d.ts +58 -0
  73. package/types/ngx-com-components-popover-testing.d.ts +63 -0
  74. package/types/ngx-com-components-radio-testing.d.ts +86 -0
  75. package/types/ngx-com-components-segmented-control-testing.d.ts +66 -0
  76. package/types/ngx-com-components-sort-testing.d.ts +62 -0
  77. package/types/ngx-com-components-switch-testing.d.ts +52 -0
  78. package/types/ngx-com-components-table-testing.d.ts +124 -0
  79. package/types/ngx-com-components-tabs-testing.d.ts +67 -0
  80. package/types/ngx-com-components-timepicker-testing.d.ts +53 -0
  81. package/types/ngx-com-components-toast-testing.d.ts +93 -0
  82. package/types/ngx-com-components-tooltip-testing.d.ts +57 -0
@@ -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 };
@@ -0,0 +1,62 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Sort direction as exposed by the aria-sort attribute. */
4
+ type SortHeaderSortDirection = 'ascending' | 'descending' | 'none';
5
+ /** Harness filters for ComSortHeaderHarness. */
6
+ interface ComSortHeaderHarnessFilters extends BaseHarnessFilters {
7
+ /** Filter by the header's text content. */
8
+ label?: string | RegExp;
9
+ /** Filter by the column id (comSortHeader attribute value). */
10
+ id?: string | RegExp;
11
+ /** Filter by the current sort direction. */
12
+ sortDirection?: SortHeaderSortDirection;
13
+ }
14
+ /** Harness filters for ComSortHarness. */
15
+ type ComSortHarnessFilters = BaseHarnessFilters;
16
+ /**
17
+ * Harness for interacting with a sort header in tests.
18
+ */
19
+ declare class ComSortHeaderHarness extends ComponentHarness {
20
+ static hostSelector: string;
21
+ /**
22
+ * Gets a HarnessPredicate for matching sort headers.
23
+ * @param options Filter options.
24
+ */
25
+ static with(options?: ComSortHeaderHarnessFilters): HarnessPredicate<ComSortHeaderHarness>;
26
+ /** Gets the header's text content. */
27
+ getLabel(): Promise<string>;
28
+ /** Gets the column id (comSortHeader attribute value). */
29
+ getId(): Promise<string>;
30
+ /** Gets the current sort direction from aria-sort. */
31
+ getSortDirection(): Promise<SortHeaderSortDirection>;
32
+ /** Whether this header is actively sorted (direction is not 'none'). */
33
+ isActive(): Promise<boolean>;
34
+ /** Whether this header is disabled. */
35
+ isDisabled(): Promise<boolean>;
36
+ /** Clicks the header to cycle sort direction. */
37
+ click(): Promise<void>;
38
+ /** Focuses the header element. */
39
+ focus(): Promise<void>;
40
+ /** Blurs the header element. */
41
+ blur(): Promise<void>;
42
+ /** Whether the header element is focused. */
43
+ isFocused(): Promise<boolean>;
44
+ }
45
+ /**
46
+ * Harness for interacting with a sort container in tests.
47
+ */
48
+ declare class ComSortHarness extends ComponentHarness {
49
+ static hostSelector: string;
50
+ /**
51
+ * Gets a HarnessPredicate for matching sort containers.
52
+ * @param options Filter options.
53
+ */
54
+ static with(options?: ComSortHarnessFilters): HarnessPredicate<ComSortHarness>;
55
+ /** Gets all sort headers, optionally filtered. */
56
+ getSortHeaders(filters?: ComSortHeaderHarnessFilters): Promise<ComSortHeaderHarness[]>;
57
+ /** Gets the actively sorted header, or null if none is sorted. */
58
+ getActiveHeader(): Promise<ComSortHeaderHarness | null>;
59
+ }
60
+
61
+ export { ComSortHarness, ComSortHeaderHarness };
62
+ export type { ComSortHarnessFilters, ComSortHeaderHarnessFilters, SortHeaderSortDirection };
@@ -0,0 +1,52 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComSwitchHarness. */
4
+ interface ComSwitchHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the switch's label text. */
6
+ label?: string | RegExp;
7
+ /** Filter by whether the switch is disabled. */
8
+ disabled?: boolean;
9
+ /** Filter by whether the switch is checked. */
10
+ checked?: boolean;
11
+ }
12
+ /**
13
+ * Harness for interacting with a ComSwitch in tests.
14
+ */
15
+ declare class ComSwitchHarness extends ComponentHarness {
16
+ static hostSelector: string;
17
+ private readonly label;
18
+ private readonly input;
19
+ private readonly labelText;
20
+ /**
21
+ * Gets a HarnessPredicate for matching switches.
22
+ * @param options Filter options.
23
+ */
24
+ static with(options?: ComSwitchHarnessFilters): HarnessPredicate<ComSwitchHarness>;
25
+ /** Whether the switch is currently checked. */
26
+ isChecked(): Promise<boolean>;
27
+ /** Whether the switch is disabled. */
28
+ isDisabled(): Promise<boolean>;
29
+ /** Whether the switch is required. */
30
+ isRequired(): Promise<boolean>;
31
+ /** Gets the switch's label text. */
32
+ getLabelText(): Promise<string>;
33
+ /** Gets the switch's name attribute. */
34
+ getName(): Promise<string | null>;
35
+ /** Gets the switch's aria-label attribute. */
36
+ getAriaLabel(): Promise<string | null>;
37
+ /** Toggles the switch by clicking its label. */
38
+ toggle(): Promise<void>;
39
+ /** Checks the switch if it is not already checked. */
40
+ check(): Promise<void>;
41
+ /** Unchecks the switch if it is currently checked. */
42
+ uncheck(): Promise<void>;
43
+ /** Focuses the switch's input element. */
44
+ focus(): Promise<void>;
45
+ /** Blurs the switch's input element. */
46
+ blur(): Promise<void>;
47
+ /** Whether the switch's input element is focused. */
48
+ isFocused(): Promise<boolean>;
49
+ }
50
+
51
+ export { ComSwitchHarness };
52
+ export type { ComSwitchHarnessFilters };