/**
 * Check if a modal was opened
 * @param  {String}   modalType  The type of modal that is expected (alertbox,
 *                               confirmbox or prompt)
 * @param  {String}   falseCase Whether to check if the modal was opened or not
 */
import {CustomExpect} from "../../common-helpers/custom-expect";
import {browser, $, $$, expect} from '@wdio/globals'

// export default async function (modalType: 'alertbox' | 'confirmbox' | 'prompt', falseCase: boolean) {
export default async function (falseCase: boolean) {
    // /**
    //  * The text of the prompt
    //  * @type {String}
    //  */
    let promptText = await browser.getAlertText();

    if (falseCase) {
        CustomExpect.expectToEqual(promptText, null, `Modal text is not NULL`);
    } else {
        CustomExpect.expectNotToEqual(promptText, null, `Modal text is NULL`);
    }
};
