import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('page schema settings', ()=>{
    const showMenu = async (page)=>{
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await page.getByLabel('designer-schema-settings-Page').hover();
    };
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('enable page header & display page title & edit page title & enable page tabs', async (param)=>{
        let { page, mockPage } = param;
        await mockPage({
            name: 'page'
        }).goto();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.locator('.ant-page-header')).toBeVisible();
        await showMenu(page);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Enable page header'
        }).getByRole('switch')).toBeChecked();
        await page.getByRole('menuitem', {
            name: 'Enable page header'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Enable page header'
        }).getByRole('switch')).not.toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.locator('.ant-page-header')).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Display page title'
        })).not.toBeVisible();
        await page.getByRole('menuitem', {
            name: 'Enable page header'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Display page title'
        }).getByRole('switch')).toBeChecked();
        await page.getByRole('menuitem', {
            name: 'Display page title'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Display page title'
        }).getByRole('switch')).not.toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.locator('.ant-page-header').getByText('page')).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Edit page title'
        })).not.toBeVisible();
        await page.getByRole('menuitem', {
            name: 'Display page title'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Edit page title'
        }).click();
        await page.getByLabel('block-item-Input-Title').getByRole('textbox').fill('new page title');
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('new page title')).toBeVisible();
        await showMenu(page);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Enable page tabs'
        }).getByRole('switch')).not.toBeChecked();
        await page.getByRole('menuitem', {
            name: 'Enable page tabs'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Enable page tabs'
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('schema-initializer-Page-tabs')).toBeVisible();
        await page.getByLabel('schema-initializer-Page-tabs').click();
        await page.getByLabel('block-item-Input-Tab name').getByRole('textbox').click();
        await page.getByLabel('block-item-Input-Tab name').getByRole('textbox').fill('new tab');
        await page.getByRole('button', {
            name: 'Select icon'
        }).click();
        await page.getByLabel('account-book').locator('svg').click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('new tab')).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('account-book').locator('svg')).toBeVisible();
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('tabs schema settings', ()=>{
    async function showSettings(page) {
        await page.getByText('Unnamed').hover();
        await page.getByRole('tab').getByLabel('designer-schema-settings-Page').hover();
    }
    async function enablePageTabs(page) {
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await page.getByRole('button', {
            name: 'designer-schema-settings-Page'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Enable page tabs'
        }).click();
        await page.mouse.move(300, 0);
    }
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('edit', async (param)=>{
        let { page, mockPage } = param;
        await mockPage().goto();
        await enablePageTabs(page);
        await showSettings(page);
        await page.getByRole('menuitem', {
            name: 'Edit',
            exact: true
        }).click();
        await page.getByLabel('block-item-Input-Tab name').getByRole('textbox').click();
        await page.getByLabel('block-item-Input-Tab name').getByRole('textbox').fill('new name of page tab');
        await page.getByRole('button', {
            name: 'Select icon'
        }).click();
        await page.getByLabel('account-book').locator('svg').click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('new name of page tab')).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('account-book').locator('svg')).toBeVisible();
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('delete', async (param)=>{
        let { page, mockPage } = param;
        await mockPage().goto();
        await enablePageTabs(page);
        await showSettings(page);
        await page.getByRole('menuitem', {
            name: 'Delete',
            exact: true
        }).click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Unnamed')).toBeHidden();
    });
});
