import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('collapse schema settings', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('supported options', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyFilterCollapseBlock).goto();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByLabel('block-item-CardItem-general-filter-collapse').hover();
                await page.getByLabel('designer-schema-settings-CardItem-AssociationFilter.BlockDesigner-general').hover();
            },
            supportedOptions: [
                'Edit block title',
                'Save as template',
                'Connect data blocks',
                'Delete'
            ]
        });
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('connect data blocks', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('connecting two blocks of the same collection', async (param)=>{
            let { page, mockPage, mockRecords } = param;
            const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneCollapseAndOneTableWithSameCollection).waitForInit();
            const records = await mockRecords('general', [
                {
                    singleSelect: 'option1'
                },
                {
                    singleSelect: 'option2'
                },
                {
                    singleSelect: 'option3'
                }
            ]);
            await nocoPage.goto();
            await page.getByLabel('block-item-CardItem-general-filter-collapse').hover();
            await page.getByLabel('designer-schema-settings-CardItem-AssociationFilter.BlockDesigner-general').hover();
            await page.getByRole('menuitem', {
                name: 'Connect data blocks'
            }).hover();
            await page.getByRole('menuitem', {
                name: 'General'
            }).click();
            await page.getByRole('button', {
                name: 'right singleSelect search'
            }).click();
            await page.getByLabel('block-item-CardItem-general-filter-collapse').getByText('Option1').click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: 'Option2'
            })).toBeHidden();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: 'Option3'
            })).toBeHidden();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row', {
                name: 'Option1'
            })).toBeVisible();
            await page.getByLabel('block-item-CardItem-general-filter-collapse').getByText('Option1').click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-table').getByRole('row')).toHaveCount(records.length + 1);
        });
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('fields schema settings', ()=>{});
