/**
 * Page object for the `nimble-chip` component to provide consistent ways
 * of querying and interacting with the component during tests.
 */
export class ChipPageObject {
    constructor(chipElement) {
        this.chipElement = chipElement;
    }
    isRemoveButtonVisible() {
        const removeButton = this.getRemoveButton();
        return !!removeButton;
    }
    getRemoveButtonTextContent() {
        const removeButton = this.getRemoveButton();
        return removeButton?.textContent?.trim() ?? '';
    }
    clickRemoveButton() {
        const removeButton = this.getRemoveButton();
        if (removeButton) {
            removeButton.click();
        }
        else {
            throw new Error('Remove button not found');
        }
    }
    getRemoveButtonTabIndex() {
        const removeButton = this.getRemoveButton();
        if (removeButton) {
            return removeButton.getAttribute('tabindex');
        }
        throw new Error('Remove button not found');
    }
    getRemoveButton() {
        return (this.chipElement.shadowRoot?.querySelector('.remove-button') ?? null);
    }
}
//# sourceMappingURL=chip.pageobject.js.map