import { processUpdates } from '../../../testing/async-helpers';
/**
 * A page object for the elements that use the error pattern mixin.
 */
export class SeverityPatternPageObject {
    constructor(element) {
        this.element = element;
    }
    getDisplayedSeverityText() {
        const severityTextDiv = this.getSeverityTextElement();
        if (!severityTextDiv
            || getComputedStyle(severityTextDiv).display === 'none') {
            return '';
        }
        return severityTextDiv.textContent?.trim() ?? '';
    }
    getSeverityTextTitle() {
        const severityTextDiv = this.getSeverityTextElement();
        if (!severityTextDiv) {
            throw new Error('Severity text element not found');
        }
        return severityTextDiv.title;
    }
    dispatchEventToSeverityText(event) {
        const severityTextDiv = this.getSeverityTextElement();
        if (!severityTextDiv) {
            throw new Error('Severity text element not found');
        }
        severityTextDiv.dispatchEvent(event);
        processUpdates();
    }
    clickSeverityText() {
        const severityTextDiv = this.getSeverityTextElement();
        if (!severityTextDiv) {
            throw new Error('Severity text element not found');
        }
        severityTextDiv.click();
    }
    getSeverityTextElement() {
        return this.element.shadowRoot.querySelector('.severity-text');
    }
}
//# sourceMappingURL=severity-pattern.pageobject.js.map