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> </script>
<template> <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> <NcTooltip>
<template #title> {{ $t('labels.clickToCopyViewID') }} </template> <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"> <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') }} {{ $t('activity.renameView') }}
</NcMenuItem> </NcMenuItem>
<NcMenuItem @click="onDuplicate"> <NcMenuItem @click="onDuplicate">
<GeneralIcon icon="duplicate" /> <GeneralIcon icon="duplicate" class="nc-view-copy-icon" />
{{ $t('labels.duplicateView') }} {{ $t('labels.duplicateView') }}
</NcMenuItem> </NcMenuItem>
<NcDivider /> <NcDivider />
@ -240,7 +240,7 @@ const onDelete = async () => {
<template v-if="!view.is_default"> <template v-if="!view.is_default">
<NcDivider /> <NcDivider />
<NcMenuItem class="!hover:bg-red-50 !text-red-500" @click="onDelete"> <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', { $t('general.deleteEntity', {
entity: $t('objects.view'), entity: $t('objects.view'),

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

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

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

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

Loading…
Cancel
Save