"use strict";
var __webpack_exports__ = {};
const e2e_namespaceObject = require("@tachybase/test/e2e");
e2e_namespaceObject.test.describe('filter block schema settings', ()=>{
    (0, e2e_namespaceObject.test)('supported options', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(e2e_namespaceObject.oneEmptyFilterFormBlock).goto();
        await (0, e2e_namespaceObject.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByLabel('block-item-CardItem-general-filter-form').hover();
                await page.getByLabel('designer-schema-settings-CardItem-FormV2.FilterDesigner-general').hover();
            },
            supportedOptions: [
                'Edit block title',
                'Save as block template',
                'Linkage rules',
                'Connect data blocks',
                'Delete'
            ]
        });
    });
    e2e_namespaceObject.test.describe('connect data blocks', ()=>{
        (0, e2e_namespaceObject.test)('connecting two blocks of the same collection', async (param)=>{
            let { page, mockPage, mockRecords } = param;
            const nocoPage = await mockPage(e2e_namespaceObject.oneFormAndOneTableWithSameCollection).waitForInit();
            const records = await mockRecords('general', 3);
            await nocoPage.goto();
            await page.getByLabel('block-item-CardItem-general-filter-form').hover();
            await page.getByLabel('designer-schema-settings-CardItem-FormV2.FilterDesigner-general').hover();
            await page.getByRole('menuitem', {
                name: 'Connect data blocks'
            }).hover();
            await page.getByRole('menuitem', {
                name: 'General'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-filter-form-general.singleLineText-singleLineText').getByRole('textbox').click();
            await page.getByLabel('block-item-CollectionField-general-filter-form-general.singleLineText-singleLineText').getByRole('textbox').fill(records[0].singleLineText);
            await page.getByLabel('action-Action-Filter records-submit-general-filter-form').click();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[1].singleLineText
            })).toBeHidden();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[2].singleLineText
            })).toBeHidden();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[0].singleLineText
            })).toBeVisible();
            await page.getByLabel('action-Action-Reset records-general-filter-form').click();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[1].singleLineText
            })).toBeVisible();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[2].singleLineText
            })).toBeVisible();
            await (0, e2e_namespaceObject.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: records[0].singleLineText
            })).toBeVisible();
        });
    });
});
e2e_namespaceObject.test.describe('actions schema settings', ()=>{
    (0, e2e_namespaceObject.test)('supported options', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(e2e_namespaceObject.oneEmptyFilterFormBlock).goto();
        await page.getByLabel('schema-initializer-ActionBar-filterForm:configureActions-general').hover();
        await page.getByRole('menuitem', {
            name: 'Filter'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Reset'
        }).click();
        await (0, e2e_namespaceObject.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByLabel('action-Action-Filter-submit-general-filter-form').hover();
                await page.getByRole('button', {
                    name: 'designer-schema-settings-Action'
                }).hover();
            },
            supportedOptions: [
                'Edit button',
                'Delete'
            ]
        });
        await (0, e2e_namespaceObject.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByLabel('action-Action-Reset-general-filter-form').hover();
                await page.getByRole('button', {
                    name: 'designer-schema-settings-Action'
                }).hover();
            },
            supportedOptions: [
                'Edit button',
                'Delete'
            ]
        });
    });
});
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
});
