import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('where filter form 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, 'Filter form');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-users-filter-form')).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 } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyFilterFormBlock).goto();
        const formItemInitializer = page.getByLabel('schema-initializer-Grid-filterForm:configureFields-general');
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'ID',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'ID',
            exact: true
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-filter-form-general.id-ID')).toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'ID',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'ID',
            exact: true
        }).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-filter-form-general.id-ID')).not.toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        await page.getByRole('menuitem', {
            name: 'Nickname'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        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-filter-form-general.manyToOne.nickname')).toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        await page.getByRole('menuitem', {
            name: 'Nickname'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Many to one'
        }).nth(1).hover();
        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-filter-form-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-filter-form')).toBeVisible();
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.pgOnly('display inherit fields', async (param)=>{
        let { page, mockPage } = param;
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('configure actions', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('filter & reset', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.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, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Filter'
        }).getByRole('switch')).toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Reset'
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action-Filter-submit-general-filter-form')).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action-Reset-general-filter-form')).toBeVisible();
        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, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Filter'
        }).getByRole('switch')).not.toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Reset'
        }).getByRole('switch')).not.toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action-Filter-submit-general-filter-form')).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action-Reset-general-filter-form')).not.toBeVisible();
    });
});
