"use strict";
var __webpack_exports__ = {};
const e2e_namespaceObject = require("@tachybase/test/e2e");
e2e_namespaceObject.test.describe('where single data details block can be added', ()=>{
    (0, e2e_namespaceObject.test)('popup', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        const nocoPage = await mockPage(e2e_namespaceObject.oneEmptyTableBlockWithActions).waitForInit();
        await mockRecord('general');
        await nocoPage.goto();
        await page.getByLabel('action-Action.Link-View-view-general-table-0').click();
        await page.getByLabel('schema-initializer-Grid-popup:common:addBlock-general').hover();
        await page.getByRole('menuitem', {
            name: 'Details'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Current record'
        }).click();
        await page.mouse.move(300, 0);
        await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-details')).toBeVisible();
    });
});
e2e_namespaceObject.test.describe('configure actions', ()=>{
    (0, e2e_namespaceObject.test)('edit & delete & duplicate & print & customize', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        const nocoPage = await mockPage(e2e_namespaceObject.oneEmptyTableBlockWithActions).waitForInit();
        await mockRecord('general');
        await nocoPage.goto();
        await page.getByLabel('action-Action.Link-View-view-general-table-0').click();
        await page.getByLabel('schema-initializer-Grid-popup:common:addBlock-general').hover();
        await page.getByRole('menuitem', {
            name: 'Details'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Current record'
        }).click();
        await page.mouse.move(300, 0);
        await createAction(page, 'Edit');
        await (0, e2e_namespaceObject.expect)(page.getByLabel('action-Action-Edit-update-')).toBeVisible();
        await (0, e2e_namespaceObject.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByLabel('action-Action-Edit-update-').hover();
                await page.getByRole('button', {
                    name: 'designer-schema-settings-Action-actionSettings:edit-general'
                }).hover();
            },
            supportedOptions: [
                'Edit button',
                'Linkage rules',
                'Open mode',
                'Popup size',
                'Delete'
            ]
        });
        await deleteAction(page, 'action-Action-Edit-update-');
        await createAction(page, 'Delete');
        await (0, e2e_namespaceObject.expect)(page.getByLabel('action-Action-Delete-destroy-general-details-')).toBeVisible();
        await createAction(page, 'Print');
        await (0, e2e_namespaceObject.expect)(page.getByLabel('action-Action-Print-print-')).toBeVisible();
        await createCustomAction(page, 'Popup');
        await (0, e2e_namespaceObject.expect)(page.getByLabel('action-Action-Popup-customize')).toBeVisible();
        await createCustomAction(page, 'Update record');
        await (0, e2e_namespaceObject.expect)(page.getByLabel('action-Action-Update record-')).toBeVisible();
    });
});
e2e_namespaceObject.test.describe('configure fields', ()=>{});
async function createAction(page, name) {
    await page.getByLabel('schema-initializer-ActionBar-details:configureActions-general').hover();
    await page.getByRole('menuitem', {
        name: name
    }).click();
    await (0, e2e_namespaceObject.expect)(page.getByRole('menuitem', {
        name: name
    }).getByRole('switch')).toBeChecked();
    await page.mouse.move(300, 0);
}
async function createCustomAction(page, name) {
    await page.getByLabel('schema-initializer-ActionBar-details:configureActions-general').hover();
    await page.getByRole('menuitem', {
        name: 'Customize'
    }).hover();
    await page.getByRole('menuitem', {
        name: name
    }).click();
    await page.mouse.move(0, 400);
}
async function deleteAction(page, label) {
    await page.getByLabel(label).hover();
    await page.getByRole('button', {
        name: 'designer-schema-settings-Action-'
    }).hover();
    await page.getByRole('menuitem', {
        name: 'Delete'
    }).click();
    await page.mouse.move(0, 300);
    await page.getByRole('button', {
        name: 'OK',
        exact: true
    }).click();
}
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
