@skyux/datetime 11.13.1 → 11.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1jYWxlbmRhci1oYXJuZXNzLmZpbHRlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvZGF0ZXRpbWUvdGVzdGluZy9zcmMvZGF0ZXBpY2tlci9kYXRlcGlja2VyLWNhbGVuZGFyLWhhcm5lc3MuZmlsdGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQmFzZUhhcm5lc3NGaWx0ZXJzIH0gZnJvbSAnQGFuZ3VsYXIvY2RrL3Rlc3RpbmcnO1xuXG4vKipcbiAqIEEgc2V0IG9mIGNyaXRlcmlhIHRoYXQgY2FuIGJlIHVzZWQgdG8gZmlsdGVyIGEgbGlzdCBvZiBgU2t5RGF0ZXBpY2tlckNhbGVuZGFySGFybmVzc2AgaW5zdGFuY2VzLlxuICovXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWVtcHR5LWludGVyZmFjZSwgQHR5cGVzY3JpcHQtZXNsaW50L25vLWVtcHR5LW9iamVjdC10eXBlXG5leHBvcnQgaW50ZXJmYWNlIFNreURhdGVwaWNrZXJDYWxlbmRhckhhcm5lc3NGaWx0ZXJzXG4gIGV4dGVuZHMgQmFzZUhhcm5lc3NGaWx0ZXJzIHt9XG4iXX0=
@@ -0,0 +1,88 @@
1
+ import { HarnessPredicate } from '@angular/cdk/testing';
2
+ import { SkyComponentHarness } from '@skyux/core/testing';
3
+ /**
4
+ * Harness for interacting with datepicker calendar in tests.
5
+ */
6
+ export class SkyDatepickerCalendarHarness extends SkyComponentHarness {
7
+ /**
8
+ * @internal
9
+ */
10
+ static { this.hostSelector = '.sky-datepicker-calendar-container'; }
11
+ #getDaypicker = this.locatorForOptional('sky-daypicker');
12
+ #getMonthpicker = this.locatorForOptional('sky-monthpicker');
13
+ #getNextButton = this.locatorFor('.sky-datepicker-btn-next');
14
+ #getPreviousButton = this.locatorFor('.sky-datepicker-btn-previous');
15
+ #getSelected = this.locatorFor('.sky-datepicker-btn-selected');
16
+ #getTitle = this.locatorFor('.sky-datepicker-calendar-title > strong');
17
+ #getTitleButton = this.locatorFor('.sky-datepicker-calendar-title');
18
+ /**
19
+ * @internal
20
+ */
21
+ static with(filters) {
22
+ return new HarnessPredicate(SkyDatepickerCalendarHarness, filters);
23
+ }
24
+ /**
25
+ * Clicks the specified date, month or year.
26
+ * @params the specified value to click, in the following format
27
+ * day format: dddd, MMMM Do YYYY
28
+ * month format: MMMM YYYY
29
+ * year format: YYYY
30
+ */
31
+ async clickDate(date) {
32
+ try {
33
+ return (await this.locatorFor(`[aria-label="${date}"]`)()).click();
34
+ }
35
+ catch {
36
+ throw new Error(`Unable to find date with label "${date}". Check that the format is correct and matches the current calendar mode.`);
37
+ }
38
+ }
39
+ /**
40
+ * Clicks the 'next' button on the calendar header.
41
+ */
42
+ async clickNextButton() {
43
+ return (await this.#getNextButton()).click();
44
+ }
45
+ /**
46
+ * Clicks the 'previous' button on the calendar header.
47
+ */
48
+ async clickPreviousButton() {
49
+ return (await this.#getPreviousButton()).click();
50
+ }
51
+ /**
52
+ * Clicks the 'title' button on the calendar header.
53
+ */
54
+ async clickTitleButton() {
55
+ const button = await this.#getTitleButton();
56
+ if (await button.hasClass('sky-btn-disabled')) {
57
+ throw new Error('Title button is disabled.');
58
+ }
59
+ return button.click();
60
+ }
61
+ /**
62
+ * Gets the current calendar mode.
63
+ */
64
+ async getCalendarMode() {
65
+ if (await this.#getDaypicker()) {
66
+ return 'day';
67
+ }
68
+ else if (await this.#getMonthpicker()) {
69
+ return 'month';
70
+ }
71
+ else {
72
+ return 'year';
73
+ }
74
+ }
75
+ /**
76
+ * Gets the current title.
77
+ */
78
+ async getCalendarTitle() {
79
+ return (await (await this.#getTitle()).text()).trim();
80
+ }
81
+ /**
82
+ * Gets the value of the currently selected calendar item.
83
+ */
84
+ async getSelectedValue() {
85
+ return (await this.#getSelected()).getAttribute('aria-label');
86
+ }
87
+ }
88
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1jYWxlbmRhci1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2RhdGV0aW1lL3Rlc3Rpbmcvc3JjL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1jYWxlbmRhci1oYXJuZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3hELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBSTFEOztHQUVHO0FBQ0gsTUFBTSxPQUFPLDRCQUE2QixTQUFRLG1CQUFtQjtJQUNuRTs7T0FFRzthQUNXLGlCQUFZLEdBQUcsb0NBQW9DLENBQUM7SUFFbEUsYUFBYSxHQUFHLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxlQUFlLENBQUMsQ0FBQztJQUN6RCxlQUFlLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixDQUFDLGlCQUFpQixDQUFDLENBQUM7SUFDN0QsY0FBYyxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUMsMEJBQTBCLENBQUMsQ0FBQztJQUM3RCxrQkFBa0IsR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLDhCQ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5kYXJNb2RlKCk6IFByb21pc2U8c3RyaW5nPiB7XG4gICAgaWYgKGF3YWl0IHRoaXMuI2dldERheXBpY2tlcigpKSB7XG4gICAgICByZXR1cm4gJ2RheSc7XG4gICAgfSBlbHNlIGlmIChhd2FpdCB0aGlzLiNnZXRNb250aHBpY2tlcigpKSB7XG4gICAgICByZXR1cm4gJ21vbnRoJztcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuICd5ZWFyJztcbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogR2V0cyB0aGUgY3VycmVudCB0aXRsZS5cbiAgICovXG4gIHB1YmxpYyBhc3luYyBnZXRDYWxlbmRhclRpdGxlKCk6IFByb21pc2U8c3RyaW5nPiB7XG4gICAgcmV0dXJuIChhd2FpdCAoYXdhaXQgdGhpcy4jZ2V0VGl0bGUoKSkudGV4dCgpKS50cmltKCk7XG4gIH1cblxuICAvKipcbiAgICogR2V0cyB0aGUgdmFsdWUgb2YgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBjYWxlbmRhciBpdGVtLlxuICAgKi9cbiAgcHVibGljIGFzeW5jIGdldFNlbGVjdGVkVmFsdWUoKTogUHJvbWlzZTxzdHJpbmcgfCBudWxsPiB7XG4gICAgcmV0dXJuIChhd2FpdCB0aGlzLiNnZXRTZWxlY3RlZCgpKS5nZXRBdHRyaWJ1dGUoJ2FyaWEtbGFiZWwnKTtcbiAgfVxufVxuIl19
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1oYXJuZXNzLmZpbHRlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvZGF0ZXRpbWUvdGVzdGluZy9zcmMvZGF0ZXBpY2tlci9kYXRlcGlja2VyLWhhcm5lc3MuZmlsdGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU2t5SGFybmVzc0ZpbHRlcnMgfSBmcm9tICdAc2t5dXgvY29yZS90ZXN0aW5nJztcblxuLyoqXG4gKiBBIHNldCBvZiBjcml0ZXJpYSB0aGF0IGNhbiBiZSB1c2VkIHRvIGZpbHRlciBhIGxpc3Qgb2YgYFNreURhdGVwaWNrZXJIYXJuZXNzYCBpbnN0YW5jZXMuXG4gKi9cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZW1wdHktaW50ZXJmYWNlLCBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZW1wdHktb2JqZWN0LXR5cGVcbmV4cG9ydCBpbnRlcmZhY2UgU2t5RGF0ZXBpY2tlckZpbHRlcnMgZXh0ZW5kcyBTa3lIYXJuZXNzRmlsdGVycyB7fVxuIl19
@@ -0,0 +1,49 @@
1
+ import { SkyComponentHarness } from '@skyux/core/testing';
2
+ import { SkyDatepickerCalendarHarness } from './datepicker-calendar-harness';
3
+ export class SkyDatepickerHarness extends SkyComponentHarness {
4
+ /**
5
+ * @internal
6
+ */
7
+ static { this.hostSelector = 'sky-datepicker, .sky-input-group'; }
8
+ #documentRootLocator = this.documentRootLocatorFactory();
9
+ #getCalendarButton = this.locatorFor('.sky-input-group-datepicker-btn');
10
+ /**
11
+ * Gets a `HarnessPredicate` that can be used to search for a
12
+ * `SkyDatepickerHarness` that meets certain criteria.
13
+ *
14
+ * These filters only work for standalone datepickers. For datepickers
15
+ * wrapped inside `sky-input-box`, place filters on the input box instead and
16
+ * query the datepicker using a `SkyInputBoxHarness`.
17
+ * For the input box implementation, see the code example.
18
+ */
19
+ static with(filters) {
20
+ return SkyDatepickerHarness.getDataSkyIdPredicate(filters);
21
+ }
22
+ /**
23
+ * Clicks the calendar button.
24
+ */
25
+ async clickCalendarButton() {
26
+ return (await this.#getCalendarButton()).click();
27
+ }
28
+ /**
29
+ * Gets the `SkyDatepickerCalendarHarness` for the calendar picker controlled by
30
+ * the datepicker. Throws an error if the calendar picker is not open.
31
+ */
32
+ async getDatepickerCalendar() {
33
+ const calendarId = await this.#getAriaControls();
34
+ if (!calendarId) {
35
+ throw new Error('Unable to get calendar picker because picker is closed.');
36
+ }
37
+ return await this.#documentRootLocator.locatorFor(SkyDatepickerCalendarHarness.with({ selector: `#${calendarId}` }))();
38
+ }
39
+ /**
40
+ * Whether the datepicker calendar picker is open.
41
+ */
42
+ async isDatepickerOpen() {
43
+ return ((await (await this.#getCalendarButton()).getAttribute('aria-expanded')) === 'true');
44
+ }
45
+ async #getAriaControls() {
46
+ return (await this.#getCalendarButton()).getAttribute('aria-controls');
47
+ }
48
+ }
49
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2RhdGV0aW1lL3Rlc3Rpbmcvc3JjL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1oYXJuZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRTFELE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRzdFLE1BQU0sT0FBTyxvQkFBcUIsU0FBUSxtQkFBbUI7SUFDM0Q7O09BRUc7YUFDVyxpQkFBWSxHQUFHLGtDQUFrQyxDQUFDO0lBRWhFLG9CQUFvQixHQUFHLElBQUksQ0FBQywwQkFBMEIsRUFBRSxDQUFDO0lBRXpELGtCQUFrQixHQUFHLElBQUksQ0FBQyxVQUFVLENBQUMsaUNBQWlDLENBQUMsQ0FBQztJQUV4RTs7Ozs7Ozs7T0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GFySWQgPSBhd2FpdCB0aGlzLiNnZXRBcmlhQ29udHJvbHMoKTtcblxuICAgIGlmICghY2FsZW5kYXJJZCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAnVW5hYmxlIHRvIGdldCBjYWxlbmRhciBwaWNrZXIgYmVjYXVzZSBwaWNrZXIgaXMgY2xvc2VkLicsXG4gICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiBhd2FpdCB0aGlzLiNkb2N1bWVudFJvb3RMb2NhdG9yLmxvY2F0b3JGb3IoXG4gICAgICBTa3lEYXRlcGlja2VyQ2FsZW5kYXJIYXJuZXNzLndpdGgoeyBzZWxlY3RvcjogYCMke2NhbGVuZGFySWR9YCB9KSxcbiAgICApKCk7XG4gIH1cblxuICAvKipcbiAgICogV2hldGhlciB0aGUgZGF0ZXBpY2tlciBjYWxlbmRhciBwaWNrZXIgaXMgb3Blbi5cbiAgICovXG4gIHB1YmxpYyBhc3luYyBpc0RhdGVwaWNrZXJPcGVuKCk6IFByb21pc2U8Ym9vbGVhbj4ge1xuICAgIHJldHVybiAoXG4gICAgICAoYXdhaXQgKFxuICAgICAgICBhd2FpdCB0aGlzLiNnZXRDYWxlbmRhckJ1dHRvbigpXG4gICAgICApLmdldEF0dHJpYnV0ZSgnYXJpYS1leHBhbmRlZCcpKSA9PT0gJ3RydWUnXG4gICAgKTtcbiAgfVxuXG4gIGFzeW5jICNnZXRBcmlhQ29udHJvbHMoKTogUHJvbWlzZTxzdHJpbmcgfCBudWxsPiB7XG4gICAgcmV0dXJuIChhd2FpdCB0aGlzLiNnZXRDYWxlbmRhckJ1dHRvbigpKS5nZXRBdHRyaWJ1dGUoJ2FyaWEtY29udHJvbHMnKTtcbiAgfVxufVxuIl19
@@ -1,3 +1,5 @@
1
1
  export { SkyDatepickerFixture } from './datepicker-fixture';
2
2
  export { SkyTimepickerFixture } from './timepicker-fixture';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9kYXRldGltZS90ZXN0aW5nL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzVELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgU2t5RGF0ZXBpY2tlckZpeHR1cmUgfSBmcm9tICcuL2RhdGVwaWNrZXItZml4dHVyZSc7XG5leHBvcnQgeyBTa3lUaW1lcGlja2VyRml4dHVyZSB9IGZyb20gJy4vdGltZXBpY2tlci1maXh0dXJlJztcbiJdfQ==
3
+ export { SkyDatepickerHarness } from './datepicker/datepicker-harness';
4
+ export { SkyDatepickerCalendarHarness } from './datepicker/datepicker-calendar-harness';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9kYXRldGltZS90ZXN0aW5nL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzVELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRzVELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRXZFLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLDBDQUEwQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgU2t5RGF0ZXBpY2tlckZpeHR1cmUgfSBmcm9tICcuL2RhdGVwaWNrZXItZml4dHVyZSc7XG5leHBvcnQgeyBTa3lUaW1lcGlja2VyRml4dHVyZSB9IGZyb20gJy4vdGltZXBpY2tlci1maXh0dXJlJztcblxuZXhwb3J0IHsgU2t5RGF0ZXBpY2tlckZpbHRlcnMgfSBmcm9tICcuL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1oYXJuZXNzLmZpbHRlcnMnO1xuZXhwb3J0IHsgU2t5RGF0ZXBpY2tlckhhcm5lc3MgfSBmcm9tICcuL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1oYXJuZXNzJztcbmV4cG9ydCB7IFNreURhdGVwaWNrZXJDYWxlbmRhckhhcm5lc3NGaWx0ZXJzIH0gZnJvbSAnLi9kYXRlcGlja2VyL2RhdGVwaWNrZXItY2FsZW5kYXItaGFybmVzcy5maWx0ZXJzJztcbmV4cG9ydCB7IFNreURhdGVwaWNrZXJDYWxlbmRhckhhcm5lc3MgfSBmcm9tICcuL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1jYWxlbmRhci1oYXJuZXNzJztcbiJdfQ==
@@ -1,5 +1,7 @@
1
1
  import { By } from '@angular/platform-browser';
2
2
  import { SkyAppTestUtility } from '@skyux-sdk/testing';
3
+ import { SkyComponentHarness } from '@skyux/core/testing';
4
+ import { HarnessPredicate } from '@angular/cdk/testing';
3
5
 
4
6
  /**
5
7
  * Allows interaction with a SKY UX datepicker component.
@@ -104,9 +106,142 @@ class SkyTimepickerFixture {
104
106
  }
105
107
  }
106
108
 
109
+ /**
110
+ * Harness for interacting with datepicker calendar in tests.
111
+ */
112
+ class SkyDatepickerCalendarHarness extends SkyComponentHarness {
113
+ /**
114
+ * @internal
115
+ */
116
+ static { this.hostSelector = '.sky-datepicker-calendar-container'; }
117
+ #getDaypicker = this.locatorForOptional('sky-daypicker');
118
+ #getMonthpicker = this.locatorForOptional('sky-monthpicker');
119
+ #getNextButton = this.locatorFor('.sky-datepicker-btn-next');
120
+ #getPreviousButton = this.locatorFor('.sky-datepicker-btn-previous');
121
+ #getSelected = this.locatorFor('.sky-datepicker-btn-selected');
122
+ #getTitle = this.locatorFor('.sky-datepicker-calendar-title > strong');
123
+ #getTitleButton = this.locatorFor('.sky-datepicker-calendar-title');
124
+ /**
125
+ * @internal
126
+ */
127
+ static with(filters) {
128
+ return new HarnessPredicate(SkyDatepickerCalendarHarness, filters);
129
+ }
130
+ /**
131
+ * Clicks the specified date, month or year.
132
+ * @params the specified value to click, in the following format
133
+ * day format: dddd, MMMM Do YYYY
134
+ * month format: MMMM YYYY
135
+ * year format: YYYY
136
+ */
137
+ async clickDate(date) {
138
+ try {
139
+ return (await this.locatorFor(`[aria-label="${date}"]`)()).click();
140
+ }
141
+ catch {
142
+ throw new Error(`Unable to find date with label "${date}". Check that the format is correct and matches the current calendar mode.`);
143
+ }
144
+ }
145
+ /**
146
+ * Clicks the 'next' button on the calendar header.
147
+ */
148
+ async clickNextButton() {
149
+ return (await this.#getNextButton()).click();
150
+ }
151
+ /**
152
+ * Clicks the 'previous' button on the calendar header.
153
+ */
154
+ async clickPreviousButton() {
155
+ return (await this.#getPreviousButton()).click();
156
+ }
157
+ /**
158
+ * Clicks the 'title' button on the calendar header.
159
+ */
160
+ async clickTitleButton() {
161
+ const button = await this.#getTitleButton();
162
+ if (await button.hasClass('sky-btn-disabled')) {
163
+ throw new Error('Title button is disabled.');
164
+ }
165
+ return button.click();
166
+ }
167
+ /**
168
+ * Gets the current calendar mode.
169
+ */
170
+ async getCalendarMode() {
171
+ if (await this.#getDaypicker()) {
172
+ return 'day';
173
+ }
174
+ else if (await this.#getMonthpicker()) {
175
+ return 'month';
176
+ }
177
+ else {
178
+ return 'year';
179
+ }
180
+ }
181
+ /**
182
+ * Gets the current title.
183
+ */
184
+ async getCalendarTitle() {
185
+ return (await (await this.#getTitle()).text()).trim();
186
+ }
187
+ /**
188
+ * Gets the value of the currently selected calendar item.
189
+ */
190
+ async getSelectedValue() {
191
+ return (await this.#getSelected()).getAttribute('aria-label');
192
+ }
193
+ }
194
+
195
+ class SkyDatepickerHarness extends SkyComponentHarness {
196
+ /**
197
+ * @internal
198
+ */
199
+ static { this.hostSelector = 'sky-datepicker, .sky-input-group'; }
200
+ #documentRootLocator = this.documentRootLocatorFactory();
201
+ #getCalendarButton = this.locatorFor('.sky-input-group-datepicker-btn');
202
+ /**
203
+ * Gets a `HarnessPredicate` that can be used to search for a
204
+ * `SkyDatepickerHarness` that meets certain criteria.
205
+ *
206
+ * These filters only work for standalone datepickers. For datepickers
207
+ * wrapped inside `sky-input-box`, place filters on the input box instead and
208
+ * query the datepicker using a `SkyInputBoxHarness`.
209
+ * For the input box implementation, see the code example.
210
+ */
211
+ static with(filters) {
212
+ return SkyDatepickerHarness.getDataSkyIdPredicate(filters);
213
+ }
214
+ /**
215
+ * Clicks the calendar button.
216
+ */
217
+ async clickCalendarButton() {
218
+ return (await this.#getCalendarButton()).click();
219
+ }
220
+ /**
221
+ * Gets the `SkyDatepickerCalendarHarness` for the calendar picker controlled by
222
+ * the datepicker. Throws an error if the calendar picker is not open.
223
+ */
224
+ async getDatepickerCalendar() {
225
+ const calendarId = await this.#getAriaControls();
226
+ if (!calendarId) {
227
+ throw new Error('Unable to get calendar picker because picker is closed.');
228
+ }
229
+ return await this.#documentRootLocator.locatorFor(SkyDatepickerCalendarHarness.with({ selector: `#${calendarId}` }))();
230
+ }
231
+ /**
232
+ * Whether the datepicker calendar picker is open.
233
+ */
234
+ async isDatepickerOpen() {
235
+ return ((await (await this.#getCalendarButton()).getAttribute('aria-expanded')) === 'true');
236
+ }
237
+ async #getAriaControls() {
238
+ return (await this.#getCalendarButton()).getAttribute('aria-controls');
239
+ }
240
+ }
241
+
107
242
  /**
108
243
  * Generated bundle index. Do not edit.
109
244
  */
110
245
 
111
- export { SkyDatepickerFixture, SkyTimepickerFixture };
246
+ export { SkyDatepickerCalendarHarness, SkyDatepickerFixture, SkyDatepickerHarness, SkyTimepickerFixture };
112
247
  //# sourceMappingURL=skyux-datetime-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-datetime-testing.mjs","sources":["../../../../../libs/components/datetime/testing/src/datepicker-fixture.ts","../../../../../libs/components/datetime/testing/src/timepicker-fixture.ts","../../../../../libs/components/datetime/testing/src/skyux-datetime-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX datepicker component.\n * @internal\n */\nexport class SkyDatepickerFixture {\n #debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-datepicker',\n );\n }\n\n /**\n * The datepicker's currently selected date.\n */\n public get date(): string {\n return this.#getDatepickerInputEl().nativeElement.value;\n }\n\n /**\n * Flag indicating if datepicker input is disabled.\n */\n public get disabled(): boolean {\n return this.#getDatepickerInputEl().nativeElement.disabled;\n }\n\n /**\n * The datepicker's calendar element.\n */\n public get calendarEl(): any {\n const button = this.#debugEl.query(\n By.css('.sky-datepicker .sky-input-group-datepicker-btn'),\n ).nativeElement;\n\n const calendarId = button.getAttribute('aria-controls');\n if (!calendarId) {\n return null;\n }\n\n return document.getElementById(calendarId);\n }\n\n /**\n * Click the calendar button to open or close calendar.\n */\n public clickDatepickerCalenderButtonEl(): void {\n this.#debugEl\n .query(By.css('.sky-datepicker .sky-input-group-datepicker-btn'))\n .nativeElement.click();\n }\n\n public clickDayEl(dayIndex: number): void {\n const dayEls = this.calendarEl.querySelectorAll('.sky-datepicker-btn-date');\n\n const dayEl = dayEls[dayIndex];\n\n if (!dayEl) {\n throw new Error(`No day exists at index ${dayIndex}.`);\n }\n\n dayEl.click();\n }\n\n #getDatepickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('.sky-datepicker input'));\n }\n}\n","import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX timepicker component.\n * @internal\n */\nexport class SkyTimepickerFixture {\n #debugEl: DebugElement;\n #fixture: ComponentFixture<any>;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.#fixture = fixture;\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-timepicker',\n );\n }\n\n /**\n * The timepicker's currently selected time.\n */\n public get value(): string {\n return this.#getTimepickerInputEl().nativeElement.value;\n }\n\n /**\n * Set the timepicker's selected time.\n */\n public set value(value: string) {\n const timepickerInputEl = this.#getTimepickerInputEl().nativeElement;\n timepickerInputEl.value = value;\n this.#fixture.detectChanges();\n\n SkyAppTestUtility.fireDomEvent(timepickerInputEl, 'change');\n this.#fixture.detectChanges();\n }\n\n /**\n * Flag indicating if timepicker input is disabled.\n */\n public get isDisabled(): boolean {\n return this.#getTimepickerInputEl().nativeElement.disabled;\n }\n\n /**\n * Set the timepicker's disabled value\n */\n public set isDisabled(value: boolean) {\n this.#getTimepickerInputEl().nativeElement.disabled = value;\n }\n\n /**\n * Flag indicating if timepicker input is valid.\n */\n public get isValid(): boolean {\n return !this.#getTimepickerInputEl().nativeElement.classList.contains(\n 'ng-invalid',\n );\n }\n\n #getTimepickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('.sky-timepicker input'));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAKA;;;AAGG;MACU,oBAAoB,CAAA;AAC/B,IAAA,QAAQ,CAAe;IAEvB,WAAY,CAAA,OAA8B,EAAE,SAAiB,EAAA;AAC3D,QAAA,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,uBA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ACnE,YAAY,CACb,CAAC;KACH;IAED,qBAAqB,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC7D;AACF;;ACnED;;AAEG;;;;"}
1
+ {"version":3,"file":"skyux-datetime-testing.mjs","sources":["../../../../../libs/components/datetime/testing/src/datepicker-fixture.ts","../../../../../libs/components/datetime/testing/src/timepicker-fixture.ts","../../../../../libs/components/datetime/testing/src/datepicker/datepicker-calendar-harness.ts","../../../../../libs/components/datetime/testing/src/datepicker/datepicker-harness.ts","../../../../../libs/components/datetime/testing/src/skyux-datetime-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX datepicker component.\n * @internal\n */\nexport class SkyDatepickerFixture {\n #debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-datepicker',\n );\n }\n\n /**\n * The datepicker's currently selected date.\n */\n public get date(): string {\n return this.#getDatepickerInputEl().nativeElement.value;\n }\n\n /**\n * Flag indicating if datepicker input is disabled.\n */\n public get disabled(): boolean {\n return this.#getDatepickerInputEl().nativeElement.disabled;\n }\n\n /**\n * The datepicker's calendar element.\n */\n public get calendarEl(): any {\n const button = this.#debugEl.query(\n By.css('.sky-datepicker .sky-input-group-datepicker-btn'),\n ).nativeElement;\n\n const calendarId = button.getAttribute('aria-controls');\n if (!calendarId) {\n return null;\n }\n\n return document.getElementById(calendarId);\n }\n\n /**\n * Click the calendar button to open or close calendar.\n */\n public clickDatepickerCalenderButtonEl(): void {\n this.#debugEl\n .query(By.css('.sky-datepicker .sky-input-group-datepicker-btn'))\n .nativeElement.click();\n }\n\n public clickDayEl(dayIndex: number): void {\n const dayEls = this.calendarEl.querySelectorAll('.sky-datepicker-btn-date');\n\n const dayEl = dayEls[dayIndex];\n\n if (!dayEl) {\n throw new Error(`No day exists at index ${dayIndex}.`);\n }\n\n dayEl.click();\n }\n\n #getDatepickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('.sky-datepicker input'));\n }\n}\n","import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX timepicker component.\n * @internal\n */\nexport class SkyTimepickerFixture {\n #debugEl: DebugElement;\n #fixture: ComponentFixture<any>;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.#fixture = fixture;\n this.#debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-timepicker',\n );\n }\n\n /**\n * The timepicker's currently selected time.\n */\n public get value(): string {\n return this.#getTimepickerInputEl().nativeElement.value;\n }\n\n /**\n * Set the timepicker's selected time.\n */\n public set value(value: string) {\n const timepickerInputEl = this.#getTimepickerInputEl().nativeElement;\n timepickerInputEl.value = value;\n this.#fixture.detectChanges();\n\n SkyAppTestUtility.fireDomEvent(timepickerInputEl, 'change');\n this.#fixture.detectChanges();\n }\n\n /**\n * Flag indicating if timepicker input is disabled.\n */\n public get isDisabled(): boolean {\n return this.#getTimepickerInputEl().nativeElement.disabled;\n }\n\n /**\n * Set the timepicker's disabled value\n */\n public set isDisabled(value: boolean) {\n this.#getTimepickerInputEl().nativeElement.disabled = value;\n }\n\n /**\n * Flag indicating if timepicker input is valid.\n */\n public get isValid(): boolean {\n return !this.#getTimepickerInputEl().nativeElement.classList.contains(\n 'ng-invalid',\n );\n }\n\n #getTimepickerInputEl(): DebugElement {\n return this.#debugEl.query(By.css('.sky-timepicker input'));\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyDatepickerCalendarHarnessFilters } from './datepicker-calendar-harness.filters';\n\n/**\n * Harness for interacting with datepicker calendar in tests.\n */\nexport class SkyDatepickerCalendarHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = '.sky-datepicker-calendar-container';\n\n #getDaypicker = this.locatorForOptional('sky-daypicker');\n #getMonthpicker = this.locatorForOptional('sky-monthpicker');\n #getNextButton = this.locatorFor('.sky-datepicker-btn-next');\n #getPreviousButton = this.locatorFor('.sky-datepicker-btn-previous');\n #getSelected = this.locatorFor('.sky-datepicker-btn-selected');\n #getTitle = this.locatorFor('.sky-datepicker-calendar-title > strong');\n #getTitleButton = this.locatorFor('.sky-datepicker-calendar-title');\n\n /**\n * @internal\n */\n public static with(\n filters: SkyDatepickerCalendarHarnessFilters,\n ): HarnessPredicate<SkyDatepickerCalendarHarness> {\n return new HarnessPredicate(SkyDatepickerCalendarHarness, filters);\n }\n\n /**\n * Clicks the specified date, month or year.\n * @params the specified value to click, in the following format\n * day format: dddd, MMMM Do YYYY\n * month format: MMMM YYYY\n * year format: YYYY\n */\n public async clickDate(date: string): Promise<void> {\n try {\n return (await this.locatorFor(`[aria-label=\"${date}\"]`)()).click();\n } catch {\n throw new Error(\n `Unable to find date with label \"${date}\". Check that the format is correct and matches the current calendar mode.`,\n );\n }\n }\n\n /**\n * Clicks the 'next' button on the calendar header.\n */\n public async clickNextButton(): Promise<void> {\n return (await this.#getNextButton()).click();\n }\n\n /**\n * Clicks the 'previous' button on the calendar header.\n */\n public async clickPreviousButton(): Promise<void> {\n return (await this.#getPreviousButton()).click();\n }\n\n /**\n * Clicks the 'title' button on the calendar header.\n */\n public async clickTitleButton(): Promise<void> {\n const button = await this.#getTitleButton();\n\n if (await button.hasClass('sky-btn-disabled')) {\n throw new Error('Title button is disabled.');\n }\n\n return button.click();\n }\n\n /**\n * Gets the current calendar mode.\n */\n public async getCalendarMode(): Promise<string> {\n if (await this.#getDaypicker()) {\n return 'day';\n } else if (await this.#getMonthpicker()) {\n return 'month';\n } else {\n return 'year';\n }\n }\n\n /**\n * Gets the current title.\n */\n public async getCalendarTitle(): Promise<string> {\n return (await (await this.#getTitle()).text()).trim();\n }\n\n /**\n * Gets the value of the currently selected calendar item.\n */\n public async getSelectedValue(): Promise<string | null> {\n return (await this.#getSelected()).getAttribute('aria-label');\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyDatepickerCalendarHarness } from './datepicker-calendar-harness';\nimport { SkyDatepickerFilters } from './datepicker-harness.filters';\n\nexport class SkyDatepickerHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-datepicker, .sky-input-group';\n\n #documentRootLocator = this.documentRootLocatorFactory();\n\n #getCalendarButton = this.locatorFor('.sky-input-group-datepicker-btn');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyDatepickerHarness` that meets certain criteria.\n *\n * These filters only work for standalone datepickers. For datepickers\n * wrapped inside `sky-input-box`, place filters on the input box instead and\n * query the datepicker using a `SkyInputBoxHarness`.\n * For the input box implementation, see the code example.\n */\n public static with(\n filters: SkyDatepickerFilters,\n ): HarnessPredicate<SkyDatepickerHarness> {\n return SkyDatepickerHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Clicks the calendar button.\n */\n public async clickCalendarButton(): Promise<void> {\n return (await this.#getCalendarButton()).click();\n }\n\n /**\n * Gets the `SkyDatepickerCalendarHarness` for the calendar picker controlled by\n * the datepicker. Throws an error if the calendar picker is not open.\n */\n public async getDatepickerCalendar(): Promise<SkyDatepickerCalendarHarness> {\n const calendarId = await this.#getAriaControls();\n\n if (!calendarId) {\n throw new Error(\n 'Unable to get calendar picker because picker is closed.',\n );\n }\n\n return await this.#documentRootLocator.locatorFor(\n SkyDatepickerCalendarHarness.with({ selector: `#${calendarId}` }),\n )();\n }\n\n /**\n * Whether the datepicker calendar picker is open.\n */\n public async isDatepickerOpen(): Promise<boolean> {\n return (\n (await (\n await this.#getCalendarButton()\n ).getAttribute('aria-expanded')) === 'true'\n );\n }\n\n async #getAriaControls(): Promise<string | null> {\n return (await this.#getCalendarButton()).getAttribute('aria-controls');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;;AAGG;MACU,oBAAoB,CAAA;AAC/B,IAAA,QAAQ,CAAe;IAEvB,WAAY,CAAA,OAA8B,EAAE,SAAiB,EAAA;AAC3D,QAAA,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,uBAAuB,CACvD,OAAO,EACP,SAAS,EACT,gBAAgB,CACjB,CAAC;KACH;AAED;;AAEG;AACH,IAAA,IAAW,IAAI,GAAA;QACb,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC;KACzD;AAED;;AAEG;AACH,IAAA,IAAW,QAAQ,GAAA;QACjB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;KAC5D;AAED;;AAEG;AACH,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAChC,EAAE,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAC1D,CAAC,aAAa,CAAC;QAEhB,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,OAAO,IAAI,CAAC;SACb;AAED,QAAA,OAAO,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;KAC5C;AAED;;AAEG;IACI,+BAA+B,GAAA;AACpC,QAAA,IAAI,CAAC,QAAQ;AACV,aAAA,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;aAChE,aAAa,CAAC,KAAK,EAAE,CAAC;KAC1B;AAEM,IAAA,UAAU,CA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AC,eAAe,CAAC,MAAM,MAAM,EAC3C;KACH;AAED,IAAA,MAAM,gBAAgB,GAAA;AACpB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;KACxE;;;ACrEH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/datetime",
3
- "version": "11.13.1",
3
+ "version": "11.15.0",
4
4
  "author": "Blackbaud, Inc.",
5
5
  "keywords": [
6
6
  "blackbaud",
@@ -41,14 +41,14 @@
41
41
  "@angular/core": "^18.2.8",
42
42
  "@angular/forms": "^18.2.8",
43
43
  "@angular/platform-browser": "^18.2.8",
44
- "@skyux-sdk/testing": "11.13.1",
45
- "@skyux/core": "11.13.1",
46
- "@skyux/forms": "11.13.1",
47
- "@skyux/i18n": "11.13.1",
48
- "@skyux/icon": "11.13.1",
49
- "@skyux/indicators": "11.13.1",
50
- "@skyux/popovers": "11.13.1",
51
- "@skyux/theme": "11.13.1",
44
+ "@skyux-sdk/testing": "11.15.0",
45
+ "@skyux/core": "11.15.0",
46
+ "@skyux/forms": "11.15.0",
47
+ "@skyux/i18n": "11.15.0",
48
+ "@skyux/icon": "11.15.0",
49
+ "@skyux/indicators": "11.15.0",
50
+ "@skyux/popovers": "11.15.0",
51
+ "@skyux/theme": "11.15.0",
52
52
  "moment": "^2.30.1"
53
53
  },
54
54
  "dependencies": {
@@ -0,0 +1,49 @@
1
+ import { HarnessPredicate } from '@angular/cdk/testing';
2
+ import { SkyComponentHarness } from '@skyux/core/testing';
3
+ import { SkyDatepickerCalendarHarnessFilters } from './datepicker-calendar-harness.filters';
4
+ /**
5
+ * Harness for interacting with datepicker calendar in tests.
6
+ */
7
+ export declare class SkyDatepickerCalendarHarness extends SkyComponentHarness {
8
+ #private;
9
+ /**
10
+ * @internal
11
+ */
12
+ static hostSelector: string;
13
+ /**
14
+ * @internal
15
+ */
16
+ static with(filters: SkyDatepickerCalendarHarnessFilters): HarnessPredicate<SkyDatepickerCalendarHarness>;
17
+ /**
18
+ * Clicks the specified date, month or year.
19
+ * @params the specified value to click, in the following format
20
+ * day format: dddd, MMMM Do YYYY
21
+ * month format: MMMM YYYY
22
+ * year format: YYYY
23
+ */
24
+ clickDate(date: string): Promise<void>;
25
+ /**
26
+ * Clicks the 'next' button on the calendar header.
27
+ */
28
+ clickNextButton(): Promise<void>;
29
+ /**
30
+ * Clicks the 'previous' button on the calendar header.
31
+ */
32
+ clickPreviousButton(): Promise<void>;
33
+ /**
34
+ * Clicks the 'title' button on the calendar header.
35
+ */
36
+ clickTitleButton(): Promise<void>;
37
+ /**
38
+ * Gets the current calendar mode.
39
+ */
40
+ getCalendarMode(): Promise<string>;
41
+ /**
42
+ * Gets the current title.
43
+ */
44
+ getCalendarTitle(): Promise<string>;
45
+ /**
46
+ * Gets the value of the currently selected calendar item.
47
+ */
48
+ getSelectedValue(): Promise<string | null>;
49
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseHarnessFilters } from '@angular/cdk/testing';
2
+ /**
3
+ * A set of criteria that can be used to filter a list of `SkyDatepickerCalendarHarness` instances.
4
+ */
5
+ export interface SkyDatepickerCalendarHarnessFilters extends BaseHarnessFilters {
6
+ }
@@ -0,0 +1,34 @@
1
+ import { HarnessPredicate } from '@angular/cdk/testing';
2
+ import { SkyComponentHarness } from '@skyux/core/testing';
3
+ import { SkyDatepickerCalendarHarness } from './datepicker-calendar-harness';
4
+ import { SkyDatepickerFilters } from './datepicker-harness.filters';
5
+ export declare class SkyDatepickerHarness extends SkyComponentHarness {
6
+ #private;
7
+ /**
8
+ * @internal
9
+ */
10
+ static hostSelector: string;
11
+ /**
12
+ * Gets a `HarnessPredicate` that can be used to search for a
13
+ * `SkyDatepickerHarness` that meets certain criteria.
14
+ *
15
+ * These filters only work for standalone datepickers. For datepickers
16
+ * wrapped inside `sky-input-box`, place filters on the input box instead and
17
+ * query the datepicker using a `SkyInputBoxHarness`.
18
+ * For the input box implementation, see the code example.
19
+ */
20
+ static with(filters: SkyDatepickerFilters): HarnessPredicate<SkyDatepickerHarness>;
21
+ /**
22
+ * Clicks the calendar button.
23
+ */
24
+ clickCalendarButton(): Promise<void>;
25
+ /**
26
+ * Gets the `SkyDatepickerCalendarHarness` for the calendar picker controlled by
27
+ * the datepicker. Throws an error if the calendar picker is not open.
28
+ */
29
+ getDatepickerCalendar(): Promise<SkyDatepickerCalendarHarness>;
30
+ /**
31
+ * Whether the datepicker calendar picker is open.
32
+ */
33
+ isDatepickerOpen(): Promise<boolean>;
34
+ }
@@ -0,0 +1,6 @@
1
+ import { SkyHarnessFilters } from '@skyux/core/testing';
2
+ /**
3
+ * A set of criteria that can be used to filter a list of `SkyDatepickerHarness` instances.
4
+ */
5
+ export interface SkyDatepickerFilters extends SkyHarnessFilters {
6
+ }
@@ -1,2 +1,6 @@
1
1
  export { SkyDatepickerFixture } from './datepicker-fixture';
2
2
  export { SkyTimepickerFixture } from './timepicker-fixture';
3
+ export { SkyDatepickerFilters } from './datepicker/datepicker-harness.filters';
4
+ export { SkyDatepickerHarness } from './datepicker/datepicker-harness';
5
+ export { SkyDatepickerCalendarHarnessFilters } from './datepicker/datepicker-calendar-harness.filters';
6
+ export { SkyDatepickerCalendarHarness } from './datepicker/datepicker-calendar-harness';