Browse Source

fix: context menu test

pull/6384/head
sreehari jayaraj 1 year ago
parent
commit
590cdc3008
  1. 5
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 2
      tests/playwright/pages/Dashboard/Grid/index.ts

5
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -1498,7 +1498,8 @@ const expandAndLooseFocus = (row: Row, col: Record<string, any>) => {
<NcMenuItem <NcMenuItem
v-if="!contextMenuClosing && !contextMenuTarget && data.some((r) => r.rowMeta.selected)" v-if="!contextMenuClosing && !contextMenuTarget && data.some((r) => r.rowMeta.selected)"
v-e="['a:row:delete-bulk']" v-e="['a:row:delete-bulk']"
class="nc-project-menu-item" class="nc-project-menu-item !text-red-600 !hover:bg-red-50"
data-testid="nc-delete-row"
@click="deleteSelectedRows" @click="deleteSelectedRows"
> >
<component :is="iconMap.delete" /> <component :is="iconMap.delete" />
@ -1554,7 +1555,7 @@ const expandAndLooseFocus = (row: Row, col: Record<string, any>) => {
<GeneralIcon icon="closeBox" class="text-gray-500" /> <GeneralIcon icon="closeBox" class="text-gray-500" />
Clear Clear
</NcMenuItem> </NcMenuItem>
<NcDivider /> <NcDivider v-if="!(!contextMenuClosing && !contextMenuTarget && data.some((r) => r.rowMeta.selected))" />
<NcMenuItem <NcMenuItem
v-if="contextMenuTarget && (selectedRange.isSingleCell() || selectedRange.isSingleRow())" v-if="contextMenuTarget && (selectedRange.isSingleCell() || selectedRange.isSingleRow())"
v-e="['a:row:delete']" v-e="['a:row:delete']"

2
tests/playwright/pages/Dashboard/Grid/index.ts

@ -259,7 +259,7 @@ export class GridPage extends BasePage {
await this.get().locator('[data-testid="nc-check-all"]').nth(0).click({ await this.get().locator('[data-testid="nc-check-all"]').nth(0).click({
button: 'right', button: 'right',
}); });
await this.rootPage.locator('text=Delete Selected Rows').click(); await this.rootPage.locator('[data-testid="nc-delete-row"]').click();
await this.dashboard.waitForLoaderToDisappear(); await this.dashboard.waitForLoaderToDisappear();
} }

Loading…
Cancel
Save