import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('where multi data details block can be added', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('page', async (param)=>{
        let { page, mockPage } = param;
        await mockPage().goto();
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.createBlockInPage)(page, 'Details');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-users-details')).toBeVisible();
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('configure fields', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('display collection fields & display association fields & add text', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyDetailsBlock).goto();
        await mockRecord('general');
        const formItemInitializer = page.getByLabel('schema-initializer-Grid-details:configureFields-general');
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'Single select',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Single select',
            exact: true
        }).getByRole('switch')).toBeChecked();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        await page.getByRole('menuitem', {
            name: 'Nickname'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Nickname'
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-details-general.singleSelect-Single select')).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-details-general.manyToOne.nickname')).toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'Single select',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Single select',
            exact: true
        }).getByRole('switch')).not.toBeChecked();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        await page.getByRole('menuitem', {
            name: 'Nickname'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Nickname'
        }).getByRole('switch')).not.toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-details-general.singleSelect-Single select')).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-details-general.manyToOne.nickname')).not.toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'Add text'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-Markdown.Void-general-details')).toBeVisible();
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('configure actions', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('edit & delete & duplicate', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyDetailsBlock).goto();
        await mockRecord('general');
        await page.getByLabel('schema-initializer-ActionBar-detailsWithPaging:configureActions-general').hover();
        await page.getByRole('menuitem', {
            name: 'Edit'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Delete'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Edit'
        }).getByRole('switch')).toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Delete'
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Edit'
        })).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Delete'
        })).toBeVisible();
        await page.getByLabel('schema-initializer-ActionBar-detailsWithPaging:configureActions-general').hover();
        await page.getByRole('menuitem', {
            name: 'Edit'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Delete'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Edit'
        }).getByRole('switch')).not.toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Delete'
        }).getByRole('switch')).not.toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Edit'
        })).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Delete'
        })).not.toBeVisible();
    });
});
