import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('where grid card 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, 'Grid Card');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-BlockItem-users-grid-card')).toBeVisible();
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('data selector popup', async (param)=>{
        let { page, mockPage } = param;
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('configure global actions', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('filter & add new & refresh', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyGridCardBlock).goto();
        await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActions-general').hover();
        await page.getByRole('menuitem', {
            name: 'Filter'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Add new'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Refresh'
        }).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: 'Add new'
        }).getByRole('switch')).toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Refresh'
        }).getByRole('switch')).toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Filter'
        })).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Add new'
        })).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Refresh'
        })).toBeVisible();
        await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActions-general').hover();
        await page.getByRole('menuitem', {
            name: 'Filter'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Add new'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Refresh'
        }).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: 'Add new'
        }).getByRole('switch')).not.toBeChecked();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Refresh'
        }).getByRole('switch')).not.toBeChecked();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Filter'
        })).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Add new'
        })).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('button', {
            name: 'Refresh'
        })).not.toBeVisible();
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('configure item actions', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('view & edit & delete', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyGridCardBlock).waitForInit();
        await mockRecord('general');
        await nocoPage.goto();
        await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
        await page.getByRole('menuitem', {
            name: 'View'
        }).click();
        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: 'View'
        }).getByRole('switch')).toBeChecked();
        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.getByLabel('action-Action.Link-View-view-general-grid-card').first()).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Edit-update-general-grid-card').first()).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Delete-destroy-general-grid-card').first()).toBeVisible();
        await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
        await page.getByRole('menuitem', {
            name: 'View'
        }).click();
        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: 'View'
        }).getByRole('switch')).not.toBeChecked();
        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.getByLabel('action-Action.Link-View-view-general-grid-card').first()).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Edit-update-general-grid-card').first()).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Delete-destroy-general-grid-card').first()).not.toBeVisible();
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('customize: popup & update record', async (param)=>{
        let { page, mockPage, mockRecord } = param;
        const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyGridCardBlock).waitForInit();
        await mockRecord('general');
        await nocoPage.goto();
        await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
        await page.getByRole('menuitem', {
            name: 'Customize'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Popup'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Update record'
        }).click();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Popup-customize:popup-general-grid-card').first()).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('action-Action.Link-Update record-customize:update-general-grid-card').first()).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;
        const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyGridCardBlock).waitForInit();
        await mockRecord('general');
        await nocoPage.goto();
        const formItemInitializer = page.getByLabel('schema-initializer-Grid-details:configureFields-general').first();
        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.wheel(0, 300);
        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-grid-card-general.id-ID').first()).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-grid-card-general.manyToOne.nickname').first()).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.wheel(0, 300);
        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-grid-card-general.id-ID').first()).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-grid-card-general.manyToOne.nickname').first()).not.toBeVisible();
        await formItemInitializer.hover();
        await page.getByRole('menuitem', {
            name: 'ID',
            exact: true
        }).hover();
        await page.mouse.wheel(0, 300);
        await page.getByRole('menuitem', {
            name: 'Add text'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-Markdown.Void-general-grid-card').first()).toBeVisible();
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.pgOnly('display inherit fields', async ()=>{});
});
