import { BaseHarnessFilters, HarnessPredicate, ComponentHarness } from '@angular/cdk/testing'; import { SkyHarnessFilters, SkyInputHarness, SkyQueryableComponentHarness, SkyComponentHarness } from '@skyux/core/testing'; import { SkyTokenHarness, SkyTokensHarness } from '@skyux/indicators/testing'; import { SkyRepeaterItemHarness, SkyRepeaterItemHarnessFilters } from '@skyux/lists/testing'; import { ComponentFixture } from '@angular/core/testing'; import * as i0 from '@angular/core'; import * as i1 from '@angular/platform-browser/animations'; import * as i2 from '@skyux/lookup'; /** * A set of criteria that can be used to filter a list of SkyAutocompleteHarness instances. */ interface SkyAutocompleteHarnessFilters extends SkyHarnessFilters { } /** * Harness to interact with the autocomplete input harness. */ declare class SkyAutocompleteInputHarness extends SkyInputHarness { /** * @internal */ static hostSelector: string; /** * Returns the value of the input's `aria-controls` attribute. */ getAriaControls(): Promise; } /** * A set of criteria that can be used to filter a list of SkyAutocompleteSearchResultHarness instances. */ interface SkyAutocompleteSearchResultHarnessFilters extends Omit { /** * Only find instances whose content matches the given value. */ text?: string | RegExp; } /** * Harness for interacting with an autocomplete search result in tests. */ declare class SkyAutocompleteSearchResultHarness extends SkyQueryableComponentHarness { /** * @internal */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyAutocompleteSearchResultHarness` that meets certain criteria. */ static with(filters: SkyAutocompleteSearchResultHarnessFilters): HarnessPredicate; /** * Returns the value of the search result's descriptor property. * This value is set by the autocomplete's `descriptorProperty` input. */ getDescriptorValue(): Promise; /** * Selects the search result. */ select(): Promise; /** * Returns the text of the search result. */ getText(): Promise; } /** * Harness for interacting with an autocomplete component in tests. */ declare class SkyAutocompleteHarness extends SkyComponentHarness { #private; /** * @internal */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyAutocompleteHarness` that meets certain criteria. */ static with(filters: SkyAutocompleteHarnessFilters): HarnessPredicate; /** * Blurs the autocomplete input. * @deprecated Call `await (await autocomplete.getControl()).blur()` instead. */ blur(): Promise; /** * Clears the autocomplete input value. * @deprecated Call `await (await autocomplete.getControl()).clear()` instead. */ clear(): Promise; /** * Enters text into the autocomplete input. * @deprecated Call `await (await autocomplete.getControl()).setValue()` instead. */ enterText(value: string): Promise; /** * Focuses the autocomplete input. * @deprecated Call `await (await autocomplete.getControl()).focus()` instead. */ focus(): Promise; /** * Gets the autocomplete `aria-labelledby` value. */ getAriaLabelledby(): Promise; /** * Gets the autocomplete input harness. */ getControl(): Promise; /** * Gets a specific autocomplete search result based on the filter criteria. * @param filter The filter criteria. */ getSearchResult(filter: SkyAutocompleteSearchResultHarnessFilters): Promise; /** * Gets an array of autocomplete search results based on the filter criteria. * If no filter is provided, returns all autocomplete search results. * @param filters The optional filter criteria. */ getSearchResults(filters?: SkyAutocompleteSearchResultHarnessFilters): Promise; /** * Returns the text content for each autocomplete search result. */ getSearchResultsText(filters?: SkyAutocompleteSearchResultHarnessFilters): Promise; /** * Gets the value of the autocomplete input. * @deprecated Call `await (await autocomplete.getControl()).getValue()` instead. */ getValue(): Promise; /** * Gets the text displayed when no search results are found. */ getNoResultsFoundText(): Promise; /** * Whether the autocomplete input is disabled. * @deprecated Call `await (await autocomplete.getControl()).isDisabled()` instead. */ isDisabled(): Promise; /** * Whether the autocomplete input is focused. * @deprecated Call `await (await autocomplete.getControl()).isFocused()` instead. */ isFocused(): Promise; /** * Whether the autocomplete is open. */ isOpen(): Promise; /** * Selects a search result. */ selectSearchResult(filters: SkyAutocompleteSearchResultHarnessFilters): Promise; /** * Clicks the "Add" button in the autocomplete search results panel. * (The "Add" functionality is not included in the public API * of a "vanilla" autocomplete component, so this method is protected * to prevent consumers of the autocomplete harness from calling it. * The lookup harness, which extends the autocomplete harness, may * still access this feature, however.) * @internal */ protected clickAddButton(): Promise; /** * Clicks the "Show more" button. * (The "Show more" functionality is not included in the public API * of a "vanilla" autocomplete component, so this method is protected * to prevent consumers of the autocomplete harness from calling it. * The lookup harness, which extends the autocomplete harness, may * still access this feature, however.) * @internal */ protected clickShowMoreButton(): Promise; } /** * A set of criteria that can be used to filter a list of `SkyCountryFieldHarness` instances. */ interface SkyCountryFieldHarnessFilters extends SkyHarnessFilters { } /** * A set of criteria that can be used to filter a list of `SkyCountryFieldSearchResultHarness` instances. */ interface SkyCountryFieldSearchResultHarnessFilters extends SkyAutocompleteSearchResultHarnessFilters { } /** * Harness for interacting with an autocomplete search result in tests. */ declare class SkyCountryFieldSearchResultHarness extends SkyAutocompleteSearchResultHarness { /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyCountryFieldSearchResultHarness` that meets certain criteria. */ static with(filters: SkyCountryFieldSearchResultHarnessFilters): HarnessPredicate; /** * Returns the value of the search result's descriptor property. * This is not needed by country field because it is always set to the country name, * and the method is marked internal to prevent it from being documented publicly. * @internal */ getDescriptorValue(): Promise; } /** * Harness for interacting with a country field component in tests. */ declare class SkyCountryFieldHarness extends SkyAutocompleteHarness { #private; /** * Finds a standard country field component, or a country field component that is wrapped by an input box component. * For input box implementations, we need to use the `.sky-input-box` selector since the `sky-country-field` * element is removed from the DOM. * @internal */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyCountryFieldHarness` that meets certain criteria. * These filters only work for standalone country fields. * For country fields wrapped inside `sky-input-box`, place filters * on the input box instead, and query the country field using a `SkyInputBoxHarness`. * For the input box implementation, see the code example. */ static with(filters: SkyCountryFieldHarnessFilters): HarnessPredicate; /** * Blurs the country field input. * @deprecated Call `await (await countryField.getControl()).blur()` instead. */ blur(): Promise; /** * Clears the country field input value. * @deprecated Call `await (await countryField.getControl()).clear()` instead. */ clear(): Promise; /** * Enters text into the country field input. * @deprecated Call `await (await countryField.getControl()).setValue()` instead. */ enterText(value: string): Promise; /** * Focuses the country field input. * @deprecated Call `await (await countryField.getControl()).focus()` instead. */ focus(): Promise; /** * Gets the country field `aria-labelledby` value. * This is not needed for country field because the id is generated internally, * and the method is marked internal to prevent it from being documented publicly. * @internal */ getAriaLabelledby(): Promise; /** * Gets a specific country field search result based on the filter criteria. * @param filter The filter criteria. */ getSearchResult(filter: SkyCountryFieldSearchResultHarnessFilters): Promise; /** * Gets an array of country field search results based on the filter criteria. * If no filter is provided, returns all country field search results. * @param filters The optional filter criteria. */ getSearchResults(filters?: SkyCountryFieldSearchResultHarnessFilters): Promise; /** * Returns the text content for each country field search result. */ getSearchResultsText(filters?: SkyCountryFieldSearchResultHarnessFilters): Promise; /** * Gets the value of the country field input. * @deprecated Call `await (await countryField.getControl()).getValue()` instead. */ getValue(): Promise; /** * Gets the text displayed when no search results are found. * For a country field, this is always the default text and the method * is marked internal to prevent it from being documented publicly. * @internal */ getNoResultsFoundText(): Promise; /** * Whether the country field input is disabled. * @deprecated Call `await (await countryField.getControl()).isDisabled()` instead. */ isDisabled(): Promise; /** * Whether the country field input is focused. * @deprecated Call `await (await countryField.getControl()).isFocused()` instead. */ isFocused(): Promise; /** * Whether the country field is open. */ isOpen(): Promise; /** * Selects a search result. */ selectSearchResult(filters: SkyCountryFieldSearchResultHarnessFilters): Promise; } /** * A set of criteria that can be used to filter a list of `SkyLookupHarness` instances. */ interface SkyLookupHarnessFilters extends SkyHarnessFilters { } /** * A set of criteria that can be used to filter a list of `SkyLookupSearchResultHarness` instances. */ interface SkyLookupSearchResultHarnessFilters extends SkyAutocompleteSearchResultHarnessFilters { } /** * Harness for interacting with an autocomplete search result in tests. */ declare class SkyLookupSearchResultHarness extends SkyAutocompleteSearchResultHarness { /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyLookupSearchResultHarness` that meets certain criteria. */ static with(filters: SkyLookupSearchResultHarnessFilters): HarnessPredicate; /** * Returns the value of the search result's descriptor property. */ getDescriptorValue(): Promise; } /** * Harness for interacting with a multiselect lookup selection in tests. */ declare class SkyLookupSelectionHarness extends SkyTokenHarness { } /** * Harness for interacting with a selection modal's search results in tests. */ declare class SkySelectionModalSearchResultHarness extends SkyRepeaterItemHarness { } /** * A set of criteria that can be used to filter a list of `SkySelectionModalSearchResultHarness` instances. */ interface SkySelectionModalSearchResultHarnessFilters extends Omit { } /** * Harness for interacting with a selection modal in tests. */ declare class SkySelectionModalHarness extends ComponentHarness { #private; /** * @internal */ static hostSelector: string; /** * Clears the text of the search input. */ clearSearchText(): Promise; /** * Enters text into the search input and performs a search. */ enterSearchText(value: string): Promise; /** * Gets the search input's aria-label. */ getSearchAriaLabel(): Promise; /** * Selects multiple search results based on a set of criteria. */ selectSearchResult(filters?: SkySelectionModalSearchResultHarnessFilters): Promise; /** * Saves any selections made and closes the modal. */ saveAndClose(): Promise; /** * * Gets the save button's aria-label. */ getSaveButtonAriaLabel(): Promise; /** * Closes the picker without saving any selections made. */ cancel(): Promise; /** * Gets a specific search result based on the filter criteria. * @param filter The filter criteria. */ getSearchResult(filter: SkySelectionModalSearchResultHarnessFilters): Promise; /** * Gets an array of search results based on the filter criteria. * If no filter is provided, returns all search results. * @param filters The optional filter criteria. */ getSearchResults(filters?: SkySelectionModalSearchResultHarnessFilters): Promise; /** * Clears all selections made. */ clearAll(): Promise; /** * * Gets the clear all button's aria-label. */ getClearAllButtonAriaLabel(): Promise; /** * Whether the selection modal is configured to allow multiple selections. */ isMultiselect(): Promise; /** * Selects all search results. */ selectAll(): Promise; /** * * Gets the select all button's aria-label. */ getSelectAllButtonAriaLabel(): Promise; /** * Loads more results in the picker. */ loadMore(): Promise; /** * Whether the selection modal is configured to show the add button. */ hasAddButton(): Promise; /** * Clicks the add button. */ clickAddButton(): Promise; /** * Gets the "Only show selected" checkbox's aria-label */ getOnlyShowSelectedAriaLabel(): Promise; } /** * A set of criteria that can be used to filter a list of `SkyLookupShowMorePickerHarness` instances. */ interface SkyLookupShowMorePickerHarnessFilters extends Omit { } /** * Harness for interacting with a lookup's "Show more" picker search results in tests. */ declare class SkyLookupShowMorePickerSearchResultHarness extends SkySelectionModalSearchResultHarness { } /** * A set of criteria that can be used to filter a list of `SkyLookupShowMorePickerSearchResultHarness` instances. */ interface SkyLookupShowMorePickerSearchResultHarnessFilters extends SkySelectionModalSearchResultHarnessFilters { } /** * Harness for interacting with a lookup's "Show more" picker in tests. */ declare class SkyLookupShowMorePickerHarness extends SkySelectionModalHarness { /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyLookupShowMorePickerHarness` that meets certain criteria. */ static with(filters: SkyLookupShowMorePickerHarnessFilters): HarnessPredicate; /** * Selects multiple search results based on a set of criteria. */ selectSearchResult(filters?: SkyLookupShowMorePickerSearchResultHarnessFilters): Promise; /** * Gets a list of search results. */ getSearchResults(filters?: SkyLookupShowMorePickerSearchResultHarnessFilters): Promise; } /** * Harness for interacting with a lookup component in tests. */ declare class SkyLookupHarness extends SkyAutocompleteHarness { #private; /** * Finds a standard lookup component, or a lookup component that is wrapped by an input box component. * For input box implementations, we need to use the `.sky-input-box` selector since the `sky-lookup` * element is removed from the DOM. * @internal */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a * `SkyLookupHarness` that meets certain criteria. * * These filters only work for standalone lookups. For lookups * wrapped inside `sky-input-box`, place filters on the input box * instead and query the datepicker using a `SkyInputBoxHarness`. * For the input box implementation, see the code example. */ static with(filters: SkyLookupHarnessFilters): HarnessPredicate; /** * Blurs the lookup input. * @deprecated Call `await (await lookup.getControl()).blur()` instead. */ blur(): Promise; /** * Clears the lookup input value. * @deprecated Call `await (await lookup.getControl()).clear()` instead. */ clear(): Promise; /** * Clicks the "Add" button on the search results panel. */ clickAddButton(): Promise; /** * Clicks the "Show more" button on the search results panel. */ clickShowMoreButton(): Promise; /** * Dismisses the selections made with a multiselect lookup. */ dismissSelections(): Promise; /** * Enters text into the lookup input. * @deprecated Call `await (await lookup.getControl()).setValue()` instead. */ enterText(value: string): Promise; /** * Focuses the lookup input. * @deprecated Call `await (await lookup.getControl()).focus()` instead. */ focus(): Promise; /** * Gets the lookup `aria-labelledby` value. * @deprecated Don't use this property. It returns a value from a deprecated input that lookup no longer uses. */ getAriaLabelledby(): Promise; /** * Gets a specific lookup search result based on the filter criteria. * @param filters The filter criteria. */ getSearchResult(filters: SkyLookupSearchResultHarnessFilters): Promise; /** * Gets an array of lookup search results based on the filter criteria. * If no filter is provided, returns all lookup search results. * @param filters The optional filter criteria. */ getSearchResults(filters?: SkyLookupSearchResultHarnessFilters): Promise; /** * Returns the text content for each lookup search result. */ getSearchResultsText(filters?: SkyLookupSearchResultHarnessFilters): Promise; /** * Gets the "Show more" picker harness. */ getShowMorePicker(): Promise; /** * Gets a list of selections made with a multiselect lookup. */ getSelections(): Promise; /** * Gets the text content of all selections made with a multiselect lookup. */ getSelectionsText(): Promise; /** * Gets the value of the lookup input. * @deprecated Call `await (await lookup.getControl()).getValue()` instead. */ getValue(): Promise; /** * Whether the lookup input is disabled. * @deprecated Call `await (await lookup.getControl()).isDisabled()` instead. */ isDisabled(): Promise; /** * Whether the lookup input is focused. * @deprecated Call `await (await lookup.getControl()).isFocused()` instead. */ isFocused(): Promise; /** * Whether the lookup allows for multiple selections. */ isMultiselect(): Promise; /** * Whether the lookup is open. */ isOpen(): Promise; /** * Selects a search result. */ selectSearchResult(filters: SkyLookupSearchResultHarnessFilters): Promise; } /** * Harness for interacting with multiselect lookup selections in tests. * @internal */ declare class SkyLookupSelectionsListHarness extends SkyTokensHarness { /** * Gets a list of selections. */ getSelections(): Promise; /** * Dismisses the selections in the list. */ dismissSelections(): Promise; /** * Gets the text content of all selections in the list. */ getSelectionsText(): Promise; } /** * Allows interaction with a SKY UX search component. * @deprecated Use `SkySearchHarness` instead. * @internal */ declare class SkySearchFixture { #private; /** * Gets the search's current text. */ get searchText(): string; /** * Gets the search's current placeholder text. */ get placeholderText(): string; constructor(fixture: ComponentFixture, skyTestId: string); /** * Applies the specified search text, invoking the search. * @param searchText The search text to apply. If none is specified, the search's * current search text will be applied. */ apply(searchText?: string): void; /** * Clears the current search text. If there is no search text or the search text is * not currently applied, an error is thrown. */ clear(): void; } /** * @internal */ declare class SkySearchTestingModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * A set of criteria that can be used to filter a list of `SkySearchHarness` instances. */ interface SkySearchHarnessFilters extends SkyHarnessFilters { } /** * Harness for interacting with a search component in tests. */ declare class SkySearchHarness extends SkyComponentHarness { #private; /** * @internal */ static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a * `SkySearchHarness` that meets certain criteria. */ static with(filters: SkySearchHarnessFilters): HarnessPredicate; /** * Blurs the search input. */ blur(): Promise; /** * Clears the search input. */ clear(): Promise; /** * Clicks the search input clear button. */ clickClearButton(): Promise; /** * Clicks search dismiss button to collapse search back to a button. */ clickDismissSearchButton(): Promise; /** * Clicks the search icon button that opens search input when it is collapsed. */ clickOpenSearchButton(): Promise; /** * Clicks the search submit button. */ clickSubmitButton(): Promise; /** * Enters text into the search input and performs a search. */ enterText(value: string): Promise; /** * Focuses the search input. */ focus(): Promise; /** * Gets the search input's `aria-label`. */ getAriaLabel(): Promise; /** * Gets the search's aria-labelledby. */ getAriaLabelledby(): Promise; /** * Gets the value of the input's placeholder attribute. */ getPlaceholderText(): Promise; /** * Gets the value of the search input. */ getValue(): Promise; /** * Whether the search input is collapsed. */ isCollapsed(): Promise; /** * Whether the search input is disabled. */ isDisabled(): Promise; /** * Whether the search input is focused. */ isFocused(): Promise; } export { SkyAutocompleteHarness, SkyAutocompleteInputHarness, SkyAutocompleteSearchResultHarness, SkyCountryFieldHarness, SkyCountryFieldSearchResultHarness, SkyLookupHarness, SkyLookupSearchResultHarness, SkyLookupSelectionHarness, SkyLookupSelectionsListHarness, SkyLookupShowMorePickerHarness, SkyLookupShowMorePickerSearchResultHarness, SkySearchFixture, SkySearchHarness, SkySearchTestingModule, SkySelectionModalHarness, SkySelectionModalSearchResultHarness }; export type { SkyAutocompleteHarnessFilters, SkyAutocompleteSearchResultHarnessFilters, SkyCountryFieldHarnessFilters, SkyCountryFieldSearchResultHarnessFilters, SkyLookupHarnessFilters, SkyLookupSearchResultHarnessFilters, SkyLookupShowMorePickerHarnessFilters, SkyLookupShowMorePickerSearchResultHarnessFilters, SkySearchHarnessFilters, SkySelectionModalSearchResultHarnessFilters };