Browse Source

fix: Integrated new view context menu to tests

pull/6888/head
Muhammed Mustafa 1 year ago
parent
commit
a56c8fac2b
  1. 6
      packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
  2. 2
      tests/playwright/pages/Dashboard/common/Toolbar/Actions/index.ts
  3. 8
      tests/playwright/tests/db/general/viewMenu.spec.ts

6
packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue

@ -143,7 +143,7 @@ const onDelete = async () => {
</script>
<template>
<NcMenu class="!min-w-70" data-testid="toolbar-actions">
<NcMenu class="!min-w-70" data-id="toolbar-actions" :data-testid="`view-sidebar-view-actions-${view!.alias || view!.title}`">
<NcTooltip>
<template #title> {{ $t('labels.clickToCopyViewID') }} </template>
<div class="flex items-center justify-between py-2 px-3 cursor-pointer hover:bg-gray-100 group" @click="onViewIdCopy">
@ -167,7 +167,7 @@ const onDelete = async () => {
{{ $t('activity.renameView') }}
</NcMenuItem>
<NcMenuItem @click="onDuplicate">
<GeneralIcon icon="duplicate" />
<GeneralIcon icon="duplicate" class="nc-view-copy-icon" />
{{ $t('labels.duplicateView') }}
</NcMenuItem>
<NcDivider />
@ -240,7 +240,7 @@ const onDelete = async () => {
<template v-if="!view.is_default">
<NcDivider />
<NcMenuItem class="!hover:bg-red-50 !text-red-500" @click="onDelete">
<GeneralIcon icon="delete" />
<GeneralIcon icon="delete" class="nc-view-delete-icon" />
{{
$t('general.deleteEntity', {
entity: $t('objects.view'),

2
tests/playwright/pages/Dashboard/common/Toolbar/Actions/index.ts

@ -13,7 +13,7 @@ export class ToolbarActionsPage extends BasePage {
}
get() {
return this.rootPage.locator(`[data-testid="toolbar-actions"]`);
return this.rootPage.locator(`[data-id="toolbar-actions"]`);
}
// todo: use enum

8
tests/playwright/tests/db/general/viewMenu.spec.ts

@ -23,8 +23,8 @@ test.describe('Grid view locked', () => {
// enable view lock
await dashboard.grid.toolbar.viewsMenu.click({
menu: 'Collaborative View',
subMenu: 'Locked View',
menu: 'Collaborative',
subMenu: 'Locked',
});
// verify view lock
@ -32,8 +32,8 @@ test.describe('Grid view locked', () => {
// enable collaborative view
await dashboard.grid.toolbar.viewsMenu.click({
menu: 'Locked View',
subMenu: 'Collaborative View',
menu: 'Locked',
subMenu: 'Collaborative',
});
await dashboard.grid.verifyCollaborativeMode();

Loading…
Cancel
Save