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.
- package/fesm2022/ngx-com-components-alert-testing.mjs +80 -0
- package/fesm2022/ngx-com-components-alert-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-calendar-testing.mjs +157 -0
- package/fesm2022/ngx-com-components-calendar-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-carousel-testing.mjs +121 -0
- package/fesm2022/ngx-com-components-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-checkbox-testing.mjs +113 -0
- package/fesm2022/ngx-com-components-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-checkbox.mjs +2 -2
- package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-com-components-code-block-testing.mjs +88 -0
- package/fesm2022/ngx-com-components-code-block-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-collapsible-testing.mjs +104 -0
- package/fesm2022/ngx-com-components-collapsible-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-confirm-testing.mjs +150 -0
- package/fesm2022/ngx-com-components-confirm-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-datepicker-testing.mjs +137 -0
- package/fesm2022/ngx-com-components-datepicker-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dialog-testing.mjs +109 -0
- package/fesm2022/ngx-com-components-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dialog.mjs +18 -18
- package/fesm2022/ngx-com-components-dialog.mjs.map +1 -1
- package/fesm2022/ngx-com-components-dropdown.mjs +39 -0
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-com-components-form-field-testing.mjs +140 -0
- package/fesm2022/ngx-com-components-form-field-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-form-field.mjs +5 -1
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
- package/fesm2022/ngx-com-components-menu-testing.mjs +298 -0
- package/fesm2022/ngx-com-components-menu-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-paginator-testing.mjs +128 -0
- package/fesm2022/ngx-com-components-paginator-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-popover-testing.mjs +115 -0
- package/fesm2022/ngx-com-components-popover-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-radio-testing.mjs +157 -0
- package/fesm2022/ngx-com-components-radio-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-radio.mjs +2 -2
- package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
- package/fesm2022/ngx-com-components-segmented-control-testing.mjs +122 -0
- package/fesm2022/ngx-com-components-segmented-control-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-sort-testing.mjs +108 -0
- package/fesm2022/ngx-com-components-sort-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-switch-testing.mjs +103 -0
- package/fesm2022/ngx-com-components-switch-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-switch.mjs +2 -2
- package/fesm2022/ngx-com-components-switch.mjs.map +1 -1
- package/fesm2022/ngx-com-components-table-testing.mjs +198 -0
- package/fesm2022/ngx-com-components-table-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tabs-testing.mjs +126 -0
- package/fesm2022/ngx-com-components-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-timepicker-testing.mjs +117 -0
- package/fesm2022/ngx-com-components-timepicker-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-toast-testing.mjs +172 -0
- package/fesm2022/ngx-com-components-toast-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-toast.mjs +4 -4
- package/fesm2022/ngx-com-components-toast.mjs.map +1 -1
- package/fesm2022/ngx-com-components-tooltip-testing.mjs +117 -0
- package/fesm2022/ngx-com-components-tooltip-testing.mjs.map +1 -0
- package/package.json +89 -1
- package/types/ngx-com-components-alert-testing.d.ts +41 -0
- package/types/ngx-com-components-calendar-testing.d.ts +80 -0
- package/types/ngx-com-components-carousel-testing.d.ts +51 -0
- package/types/ngx-com-components-checkbox-testing.d.ts +56 -0
- package/types/ngx-com-components-code-block-testing.d.ts +45 -0
- package/types/ngx-com-components-collapsible-testing.d.ts +53 -0
- package/types/ngx-com-components-confirm-testing.d.ts +78 -0
- package/types/ngx-com-components-datepicker-testing.d.ts +61 -0
- package/types/ngx-com-components-dialog-testing.d.ts +57 -0
- package/types/ngx-com-components-dropdown.d.ts +12 -0
- package/types/ngx-com-components-form-field-testing.d.ts +61 -0
- package/types/ngx-com-components-menu-testing.d.ts +167 -0
- package/types/ngx-com-components-paginator-testing.d.ts +58 -0
- package/types/ngx-com-components-popover-testing.d.ts +63 -0
- package/types/ngx-com-components-radio-testing.d.ts +86 -0
- package/types/ngx-com-components-segmented-control-testing.d.ts +66 -0
- package/types/ngx-com-components-sort-testing.d.ts +62 -0
- package/types/ngx-com-components-switch-testing.d.ts +52 -0
- package/types/ngx-com-components-table-testing.d.ts +124 -0
- package/types/ngx-com-components-tabs-testing.d.ts +67 -0
- package/types/ngx-com-components-timepicker-testing.d.ts +53 -0
- package/types/ngx-com-components-toast-testing.d.ts +93 -0
- package/types/ngx-com-components-tooltip-testing.d.ts +57 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComCalendarCellHarness. */
|
|
4
|
+
interface ComCalendarCellHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Filter by the cell's display text. */
|
|
6
|
+
text?: string | RegExp;
|
|
7
|
+
/** Filter by whether the cell is selected. */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** Filter by whether the cell is disabled. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Harness filters for ComCalendarHarness. */
|
|
13
|
+
type ComCalendarHarnessFilters = BaseHarnessFilters;
|
|
14
|
+
/**
|
|
15
|
+
* Harness for interacting with an individual calendar cell in tests.
|
|
16
|
+
*/
|
|
17
|
+
declare class ComCalendarCellHarness extends ComponentHarness {
|
|
18
|
+
static hostSelector: string;
|
|
19
|
+
private readonly button;
|
|
20
|
+
/**
|
|
21
|
+
* Gets a HarnessPredicate for matching calendar cells.
|
|
22
|
+
* @param options Filter options.
|
|
23
|
+
*/
|
|
24
|
+
static with(options?: ComCalendarCellHarnessFilters): HarnessPredicate<ComCalendarCellHarness>;
|
|
25
|
+
/** Gets the cell's display text. */
|
|
26
|
+
getText(): Promise<string>;
|
|
27
|
+
/** Gets the cell button's aria-label. */
|
|
28
|
+
getAriaLabel(): Promise<string | null>;
|
|
29
|
+
/** Whether the cell is currently selected. */
|
|
30
|
+
isSelected(): Promise<boolean>;
|
|
31
|
+
/** Whether the cell is disabled. */
|
|
32
|
+
isDisabled(): Promise<boolean>;
|
|
33
|
+
/** Whether the cell represents today's date. */
|
|
34
|
+
isToday(): Promise<boolean>;
|
|
35
|
+
/** Clicks the cell to select it. */
|
|
36
|
+
select(): Promise<void>;
|
|
37
|
+
/** Focuses the cell button. */
|
|
38
|
+
focus(): Promise<void>;
|
|
39
|
+
/** Whether the cell button is focused. */
|
|
40
|
+
isFocused(): Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Harness for interacting with a ComCalendar in tests.
|
|
44
|
+
*/
|
|
45
|
+
declare class ComCalendarHarness extends ComponentHarness {
|
|
46
|
+
static hostSelector: string;
|
|
47
|
+
private readonly prevButton;
|
|
48
|
+
private readonly periodButton;
|
|
49
|
+
private readonly nextButton;
|
|
50
|
+
/**
|
|
51
|
+
* Gets a HarnessPredicate for matching calendars.
|
|
52
|
+
* @param options Filter options.
|
|
53
|
+
*/
|
|
54
|
+
static with(options?: ComCalendarHarnessFilters): HarnessPredicate<ComCalendarHarness>;
|
|
55
|
+
/** Gets the period label text (e.g., "January 2024", "2024", "2000 – 2023"). */
|
|
56
|
+
getPeriodLabel(): Promise<string>;
|
|
57
|
+
/** Navigates to the previous period (month, year, or multi-year page). */
|
|
58
|
+
goToPreviousPage(): Promise<void>;
|
|
59
|
+
/** Navigates to the next period (month, year, or multi-year page). */
|
|
60
|
+
goToNextPage(): Promise<void>;
|
|
61
|
+
/** Whether the previous page button is disabled. */
|
|
62
|
+
isPreviousDisabled(): Promise<boolean>;
|
|
63
|
+
/** Whether the next page button is disabled. */
|
|
64
|
+
isNextDisabled(): Promise<boolean>;
|
|
65
|
+
/** Clicks the period button to switch to the next higher view (month → year → multi-year). */
|
|
66
|
+
switchView(): Promise<void>;
|
|
67
|
+
/** Gets the current calendar view. */
|
|
68
|
+
getCurrentView(): Promise<'month' | 'year' | 'multi-year'>;
|
|
69
|
+
/** Gets all calendar cells, optionally filtered. */
|
|
70
|
+
getCells(filters?: ComCalendarCellHarnessFilters): Promise<ComCalendarCellHarness[]>;
|
|
71
|
+
/** Selects a cell by its display text. Throws if no matching cell is found. */
|
|
72
|
+
selectCell(text: string): Promise<void>;
|
|
73
|
+
/** Gets all currently selected cells. */
|
|
74
|
+
getSelectedCells(): Promise<ComCalendarCellHarness[]>;
|
|
75
|
+
/** Gets the cell representing today, or null if not visible. */
|
|
76
|
+
getTodayCell(): Promise<ComCalendarCellHarness | null>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { ComCalendarCellHarness, ComCalendarHarness };
|
|
80
|
+
export type { ComCalendarCellHarnessFilters, ComCalendarHarnessFilters };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComCarouselHarness. */
|
|
4
|
+
type ComCarouselHarnessFilters = BaseHarnessFilters;
|
|
5
|
+
/**
|
|
6
|
+
* Harness for interacting with a ComCarousel in tests.
|
|
7
|
+
*/
|
|
8
|
+
declare class ComCarouselHarness extends ComponentHarness {
|
|
9
|
+
static hostSelector: string;
|
|
10
|
+
private readonly prevButton;
|
|
11
|
+
private readonly nextButton;
|
|
12
|
+
private readonly paginationTablist;
|
|
13
|
+
private readonly paginationDots;
|
|
14
|
+
private readonly slides;
|
|
15
|
+
/**
|
|
16
|
+
* Gets a HarnessPredicate for matching carousels.
|
|
17
|
+
* @param options Filter options.
|
|
18
|
+
*/
|
|
19
|
+
static with(options?: ComCarouselHarnessFilters): HarnessPredicate<ComCarouselHarness>;
|
|
20
|
+
/** Navigates to the next slide. Throws if the next button is not present. */
|
|
21
|
+
goToNext(): Promise<void>;
|
|
22
|
+
/** Navigates to the previous slide. Throws if the previous button is not present. */
|
|
23
|
+
goToPrevious(): Promise<void>;
|
|
24
|
+
/** Navigates to a specific slide by clicking its pagination dot. Throws if not found. */
|
|
25
|
+
goToSlide(index: number): Promise<void>;
|
|
26
|
+
/** Gets the index of the currently active slide based on the selected pagination dot. */
|
|
27
|
+
getCurrentIndex(): Promise<number>;
|
|
28
|
+
/** Gets the total number of slide items. */
|
|
29
|
+
getSlideCount(): Promise<number>;
|
|
30
|
+
/** Whether the next slide button is disabled. */
|
|
31
|
+
isNextDisabled(): Promise<boolean>;
|
|
32
|
+
/** Whether the previous slide button is disabled. */
|
|
33
|
+
isPreviousDisabled(): Promise<boolean>;
|
|
34
|
+
/** Whether navigation buttons (next/previous) are present. */
|
|
35
|
+
hasNavigation(): Promise<boolean>;
|
|
36
|
+
/** Whether the pagination tablist is present. */
|
|
37
|
+
hasPagination(): Promise<boolean>;
|
|
38
|
+
/** Gets the number of pagination dots. */
|
|
39
|
+
getPaginationCount(): Promise<number>;
|
|
40
|
+
/** Whether the carousel is disabled (both navigation buttons disabled). */
|
|
41
|
+
isDisabled(): Promise<boolean>;
|
|
42
|
+
/** Whether the carousel host is focused. */
|
|
43
|
+
isFocused(): Promise<boolean>;
|
|
44
|
+
/** Focuses the carousel host element. */
|
|
45
|
+
focus(): Promise<void>;
|
|
46
|
+
/** Blurs the carousel host element. */
|
|
47
|
+
blur(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { ComCarouselHarness };
|
|
51
|
+
export type { ComCarouselHarnessFilters };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComCheckboxHarness. */
|
|
4
|
+
interface ComCheckboxHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Filter by the checkbox's projected label text. */
|
|
6
|
+
label?: string | RegExp;
|
|
7
|
+
/** Filter by whether the checkbox is disabled. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Filter by whether the checkbox is checked. */
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Harness for interacting with a ComCheckbox in tests.
|
|
14
|
+
*/
|
|
15
|
+
declare class ComCheckboxHarness 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 checkboxes.
|
|
22
|
+
* @param options Filter options.
|
|
23
|
+
*/
|
|
24
|
+
static with(options?: ComCheckboxHarnessFilters): HarnessPredicate<ComCheckboxHarness>;
|
|
25
|
+
/** Whether the checkbox is currently checked. */
|
|
26
|
+
isChecked(): Promise<boolean>;
|
|
27
|
+
/** Whether the checkbox is disabled. */
|
|
28
|
+
isDisabled(): Promise<boolean>;
|
|
29
|
+
/** Whether the checkbox is in the indeterminate state. */
|
|
30
|
+
isIndeterminate(): Promise<boolean>;
|
|
31
|
+
/** Whether the checkbox is required. */
|
|
32
|
+
isRequired(): Promise<boolean>;
|
|
33
|
+
/** Gets the checkbox's projected label text. */
|
|
34
|
+
getLabelText(): Promise<string>;
|
|
35
|
+
/** Gets the checkbox's name attribute. */
|
|
36
|
+
getName(): Promise<string | null>;
|
|
37
|
+
/** Gets the checkbox's aria-label attribute. */
|
|
38
|
+
getAriaLabel(): Promise<string | null>;
|
|
39
|
+
/** Gets the checkbox's aria-labelledby attribute. */
|
|
40
|
+
getAriaLabelledby(): Promise<string | null>;
|
|
41
|
+
/** Toggles the checkbox by clicking the label element. */
|
|
42
|
+
toggle(): Promise<void>;
|
|
43
|
+
/** Checks the checkbox if it is currently unchecked. */
|
|
44
|
+
check(): Promise<void>;
|
|
45
|
+
/** Unchecks the checkbox if it is currently checked. */
|
|
46
|
+
uncheck(): Promise<void>;
|
|
47
|
+
/** Focuses the checkbox's input element. */
|
|
48
|
+
focus(): Promise<void>;
|
|
49
|
+
/** Blurs the checkbox's input element. */
|
|
50
|
+
blur(): Promise<void>;
|
|
51
|
+
/** Whether the checkbox's input element is focused. */
|
|
52
|
+
isFocused(): Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { ComCheckboxHarness };
|
|
56
|
+
export type { ComCheckboxHarnessFilters };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComCodeBlockHarness. */
|
|
4
|
+
interface ComCodeBlockHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Filter by the code block's language label. */
|
|
6
|
+
language?: string | RegExp;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Harness for interacting with a ComCodeBlock in tests.
|
|
10
|
+
*/
|
|
11
|
+
declare class ComCodeBlockHarness extends ComponentHarness {
|
|
12
|
+
static hostSelector: string;
|
|
13
|
+
private readonly codeElement;
|
|
14
|
+
private readonly preElement;
|
|
15
|
+
private readonly copyButton;
|
|
16
|
+
/**
|
|
17
|
+
* Gets a HarnessPredicate for matching code blocks.
|
|
18
|
+
* @param options Filter options.
|
|
19
|
+
*/
|
|
20
|
+
static with(options?: ComCodeBlockHarnessFilters): HarnessPredicate<ComCodeBlockHarness>;
|
|
21
|
+
/** Gets the code text content. */
|
|
22
|
+
getCode(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the language label.
|
|
25
|
+
* Returns `null` if no language is set.
|
|
26
|
+
*/
|
|
27
|
+
getLanguage(): Promise<string | null>;
|
|
28
|
+
/** Clicks the copy button to copy code to clipboard. */
|
|
29
|
+
copyToClipboard(): Promise<void>;
|
|
30
|
+
/** Whether the copy button is currently showing the "Copied" state. */
|
|
31
|
+
isCopied(): Promise<boolean>;
|
|
32
|
+
/** Gets the copy button's aria-label. */
|
|
33
|
+
getCopyButtonLabel(): Promise<string>;
|
|
34
|
+
/** Whether the code block is disabled (copy button is disabled). */
|
|
35
|
+
isDisabled(): Promise<boolean>;
|
|
36
|
+
/** Whether the code block host is focused. */
|
|
37
|
+
isFocused(): Promise<boolean>;
|
|
38
|
+
/** Focuses the code block host element. */
|
|
39
|
+
focus(): Promise<void>;
|
|
40
|
+
/** Blurs the code block host element. */
|
|
41
|
+
blur(): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { ComCodeBlockHarness };
|
|
45
|
+
export type { ComCodeBlockHarnessFilters };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComCollapsibleHarness. */
|
|
4
|
+
interface ComCollapsibleHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
/** Filter by whether the collapsible is expanded. */
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
/** Filter by whether the collapsible is disabled. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Harness for interacting with a ComCollapsible in tests.
|
|
12
|
+
*/
|
|
13
|
+
declare class ComCollapsibleHarness extends ComponentHarness {
|
|
14
|
+
static hostSelector: string;
|
|
15
|
+
private readonly trigger;
|
|
16
|
+
private readonly content;
|
|
17
|
+
/**
|
|
18
|
+
* Gets a HarnessPredicate for matching collapsibles.
|
|
19
|
+
* @param options Filter options.
|
|
20
|
+
*/
|
|
21
|
+
static with(options?: ComCollapsibleHarnessFilters): HarnessPredicate<ComCollapsibleHarness>;
|
|
22
|
+
/** Whether the collapsible is currently expanded. */
|
|
23
|
+
isExpanded(): Promise<boolean>;
|
|
24
|
+
/** Whether the collapsible is disabled. */
|
|
25
|
+
isDisabled(): Promise<boolean>;
|
|
26
|
+
/** Toggles the collapsible by clicking the trigger. */
|
|
27
|
+
toggle(): Promise<void>;
|
|
28
|
+
/** Expands the collapsible if it is currently collapsed. */
|
|
29
|
+
expand(): Promise<void>;
|
|
30
|
+
/** Collapses the collapsible if it is currently expanded. */
|
|
31
|
+
collapse(): Promise<void>;
|
|
32
|
+
/** Gets the text content of the trigger element. */
|
|
33
|
+
getTriggerText(): Promise<string>;
|
|
34
|
+
/** Gets the text content of the content element. */
|
|
35
|
+
getContentText(): Promise<string>;
|
|
36
|
+
/** Gets the role attribute of the content element. */
|
|
37
|
+
getContentRole(): Promise<string | null>;
|
|
38
|
+
/** Gets the aria-controls attribute from the trigger. */
|
|
39
|
+
getAriaControls(): Promise<string | null>;
|
|
40
|
+
/** Gets the aria-labelledby attribute from the content. */
|
|
41
|
+
getAriaLabelledby(): Promise<string | null>;
|
|
42
|
+
/** Whether the content element has the inert attribute. */
|
|
43
|
+
isContentInert(): Promise<boolean>;
|
|
44
|
+
/** Focuses the trigger element. */
|
|
45
|
+
focus(): Promise<void>;
|
|
46
|
+
/** Blurs the trigger element. */
|
|
47
|
+
blur(): Promise<void>;
|
|
48
|
+
/** Whether the trigger element is focused. */
|
|
49
|
+
isFocused(): Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { ComCollapsibleHarness };
|
|
53
|
+
export type { ComCollapsibleHarnessFilters };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/** Harness filters for ComConfirmPanelHarness. */
|
|
4
|
+
type ComConfirmPanelHarnessFilters = BaseHarnessFilters;
|
|
5
|
+
/** Harness filters for ComConfirmTriggerHarness. */
|
|
6
|
+
interface ComConfirmTriggerHarnessFilters extends BaseHarnessFilters {
|
|
7
|
+
/** Filter by the trigger element's text. */
|
|
8
|
+
text?: string | RegExp;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Harness for interacting with a confirm panel in tests.
|
|
12
|
+
*
|
|
13
|
+
* The panel renders inside a CDK overlay with `role="alertdialog"`.
|
|
14
|
+
* Obtain via `TestbedHarnessEnvironment.documentRootLoader(fixture)` or
|
|
15
|
+
* through `ComConfirmTriggerHarness.getPanel()`.
|
|
16
|
+
*/
|
|
17
|
+
declare class ComConfirmPanelHarness extends ComponentHarness {
|
|
18
|
+
static hostSelector: string;
|
|
19
|
+
private readonly alertdialog;
|
|
20
|
+
private readonly title;
|
|
21
|
+
private readonly message;
|
|
22
|
+
private readonly cancelButton;
|
|
23
|
+
private readonly confirmButton;
|
|
24
|
+
/**
|
|
25
|
+
* Gets a HarnessPredicate for matching confirm panels.
|
|
26
|
+
* @param options Filter options.
|
|
27
|
+
*/
|
|
28
|
+
static with(options?: ComConfirmPanelHarnessFilters): HarnessPredicate<ComConfirmPanelHarness>;
|
|
29
|
+
/** Gets the title text, or null if no title is present. */
|
|
30
|
+
getTitleText(): Promise<string | null>;
|
|
31
|
+
/** Gets the message text. */
|
|
32
|
+
getMessageText(): Promise<string>;
|
|
33
|
+
/** Gets the confirm button text. */
|
|
34
|
+
getConfirmButtonText(): Promise<string>;
|
|
35
|
+
/** Gets the cancel button text. */
|
|
36
|
+
getCancelButtonText(): Promise<string>;
|
|
37
|
+
/** Clicks the confirm button. */
|
|
38
|
+
confirm(): Promise<void>;
|
|
39
|
+
/** Clicks the cancel button. */
|
|
40
|
+
cancel(): Promise<void>;
|
|
41
|
+
/** Gets the `data-state` attribute on the alertdialog element. */
|
|
42
|
+
getState(): Promise<string | null>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Harness for interacting with a confirm trigger in tests.
|
|
46
|
+
*/
|
|
47
|
+
declare class ComConfirmTriggerHarness extends ComponentHarness {
|
|
48
|
+
static hostSelector: string;
|
|
49
|
+
private readonly documentRootLocator;
|
|
50
|
+
/**
|
|
51
|
+
* Gets a HarnessPredicate for matching confirm triggers.
|
|
52
|
+
* @param options Filter options.
|
|
53
|
+
*/
|
|
54
|
+
static with(options?: ComConfirmTriggerHarnessFilters): HarnessPredicate<ComConfirmTriggerHarness>;
|
|
55
|
+
/** Gets the trigger element's text. */
|
|
56
|
+
getText(): Promise<string>;
|
|
57
|
+
/** Whether the confirm panel is currently open. */
|
|
58
|
+
isOpen(): Promise<boolean>;
|
|
59
|
+
/** Opens the confirm panel if it's closed. */
|
|
60
|
+
open(): Promise<void>;
|
|
61
|
+
/** Closes the confirm panel if it's open. */
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
/** Gets the confirm panel harness, or null if the panel is closed. */
|
|
64
|
+
getPanel(): Promise<ComConfirmPanelHarness | null>;
|
|
65
|
+
/** Opens the panel and clicks the confirm button. */
|
|
66
|
+
confirm(): Promise<void>;
|
|
67
|
+
/** Opens the panel and clicks the cancel button. */
|
|
68
|
+
cancel(): Promise<void>;
|
|
69
|
+
/** Focuses the trigger element. */
|
|
70
|
+
focus(): Promise<void>;
|
|
71
|
+
/** Blurs the trigger element. */
|
|
72
|
+
blur(): Promise<void>;
|
|
73
|
+
/** Whether the trigger element is focused. */
|
|
74
|
+
isFocused(): Promise<boolean>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { ComConfirmPanelHarness, ComConfirmTriggerHarness };
|
|
78
|
+
export type { ComConfirmPanelHarnessFilters, ComConfirmTriggerHarnessFilters };
|
|
@@ -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 };
|