@octopusdeploy/design-system-components
Version:
The design systems component library.
55 lines (54 loc) • 2.49 kB
TypeScript
import type { Mock } from "vitest";
import type { SelectOption } from "../SelectOption";
export declare function getSharedSelectInteractions(label: string, onChange: Mock): {
shouldBeInDocument: () => void;
shouldHaveLabel: (labelText: string) => void;
shouldHavePlaceholder: (placeholder: string) => void;
shouldHaveDescription: (description: string) => void;
shouldHaveError: (error: string) => void;
shouldHaveRetryButton: () => void;
shouldBeDisabled: () => void;
shouldBeReadOnly: () => void;
shouldHaveFocus: () => void;
shouldHaveRequiredMarker: () => void;
shouldHaveOptionalMarker: () => void;
shouldHaveDefaultMarker: () => void;
shouldHaveAriaInvalid: (invalid: boolean) => void;
shouldHaveAriaRequired: (required: boolean) => void;
shouldHaveAriaDescribedByError: () => void;
shouldHaveAriaDescribedByDescription: () => void;
shouldHaveAriaDescribedByBoth: () => void;
shouldHaveAriaActiveDescendantForOption: (optionLabel: string) => void;
shouldNotHaveAriaActiveDescendant: () => void;
tab: () => Promise<void>;
click: () => Promise<void>;
clickRetryButton: () => Promise<void>;
pressEnter: () => Promise<void>;
pressSpace: () => Promise<void>;
pressArrowDown: () => Promise<void>;
pressArrowUp: () => Promise<void>;
pressHome: () => Promise<void>;
pressEnd: () => Promise<void>;
pressEscape: () => Promise<void>;
selectOption: (optionLabel: string) => Promise<void>;
shouldShowDropdown: () => void;
shouldNotShowDropdown: () => void;
shouldShowAllOptions: (options: SelectOption[]) => void;
shouldShowAllOptionsInOrder: (options: SelectOption[]) => void;
shouldHaveOptionFocused: (optionLabel: string) => void;
shouldHaveOptionActive: (optionLabel: string) => void;
shouldNotHaveCalledOnChange: () => void;
shouldShowLoadingIndicator: () => void;
shouldNotShowLoadingIndicator: () => void;
triggerScrollForLoadMore: () => Promise<void>;
shouldShowClearButton: () => void;
shouldNotShowClearButton: () => void;
clickClearButton: () => Promise<void>;
shouldShowSearchInput: () => void;
shouldNotShowSearchInput: () => void;
typeInSearchInput: (text: string) => Promise<void>;
shouldShowOnlyOption: (optionLabel: string) => void;
shouldShowNoResultsMessage: () => void;
shouldNotShowAnyOptions: () => void;
shouldHaveSearchInputWithAriaLabel: (ariaLabel: string) => void;
};