Browse Source

test: disable tests

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
030c9e47e8
  1. 18
      packages/nc-gui/components/dashboard/TreeView/CreateViewBtn.vue
  2. 24
      packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
  3. 2
      tests/playwright/pages/Dashboard/Sidebar/index.ts
  4. 1
      tests/playwright/tests/db/views/viewCalendar.spec.ts

18
packages/nc-gui/components/dashboard/TreeView/CreateViewBtn.vue

@ -103,13 +103,21 @@ async function onOpenModal({
close(1000)
}
}
const isEasterEggEnabled = ref(false)
watch(isOpen, (val) => {
if (!val) {
isEasterEggEnabled.value = false
}
})
</script>
<template>
<NcDropdown v-model:visible="isOpen" :overlay-class-name="overlayClassName" destroy-popup-on-hide @click.stop="isOpen = true">
<slot />
<template #overlay>
<NcMenu class="max-w-48">
<NcMenu class="max-w-48" @dblclick.stop="isEasterEggEnabled = true">
<NcMenuItem @click.stop="onOpenModal({ type: ViewTypes.GRID })">
<div class="item" data-testid="sidebar-view-create-grid">
<div class="item-inner">
@ -155,11 +163,15 @@ async function onOpenModal({
<GeneralIcon v-else class="plus" icon="plus" />
</div>
</NcMenuItem>
<NcMenuItem data-testid="sidebar-view-create-calendar" @click="onOpenModal({ type: ViewTypes.CALENDAR })">
<NcMenuItem
v-if="isEasterEggEnabled"
data-testid="sidebar-view-create-calendar"
@click="onOpenModal({ type: ViewTypes.CALENDAR })"
>
<div class="item">
<div class="item-inner">
<GeneralViewIcon :meta="{ type: ViewTypes.CALENDAR }" />
<div>{{$t('objects.viewType.calendar')}}</div>
<div>{{ $t('objects.viewType.calendar') }}</div>
</div>
<GeneralLoader v-if="toBeCreateType === ViewTypes.CALENDAR && isViewListLoading" />

24
packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue

@ -299,6 +299,7 @@ const useDebouncedRowUpdate = useDebounceFn((row: Row, updateProperty: string[],
// When the user is dragging a record, we calculate the new start and end date based on the mouse position
const calculateNewRow = (event: MouseEvent) => {
if (!container.value || !dragRecord.value) return { newRow: null, updateProperty: [] }
const { top } = container.value.getBoundingClientRect()
const { scrollHeight } = container.value
@ -402,7 +403,7 @@ const onResize = (event: MouseEvent) => {
const hour = Math.max(Math.floor(percentY * 23), 0)
let newRow
let newRow: Row | null = null
let updateProperty: string[] = []
if (resizeDirection.value === 'right') {
@ -446,15 +447,13 @@ const onResize = (event: MouseEvent) => {
},
}
}
if (!newRow) return
const newPk = extractPkFromRow(newRow.row, meta.value!.columns!)
formattedData.value = formattedData.value.map((r) => {
const pk = extractPkFromRow(r.row, meta.value!.columns!)
if (pk === newPk) {
return newRow
}
return r
})
return pk === newPk ? newRow : r
}) as Row[]
useDebouncedRowUpdate(newRow, updateProperty, false)
}
@ -504,6 +503,7 @@ const stopDrag = (event: MouseEvent) => {
dragElement.value = null
}
if (!newRow) return
updateRowProperty(newRow, updateProperty, false)
document.removeEventListener('mousemove', onDrag)
@ -686,7 +686,7 @@ const viewMore = (hour: dayjs.Dayjs) => {
class="absolute draggable-record group cursor-pointer pointer-events-auto"
@mousedown="dragStart($event, record)"
@mouseleave="hoverRecord = null"
@mouseover="hoverRecord = record.rowMeta.id"
@mouseover="hoverRecord = record.rowMeta.id as string"
@dragover.prevent
>
<LazySmartsheetRow :row="record">
@ -701,20 +701,20 @@ const viewMore = (hour: dayjs.Dayjs) => {
<template v-if="!isRowEmpty(record, displayField)">
<div
:class="{
'!mt-2': displayField.uidt === UITypes.SingleLineText,
'!mt-1': displayField.uidt === UITypes.MultiSelect || displayField.uidt === UITypes.SingleSelect,
'!mt-2': displayField!.uidt === UITypes.SingleLineText,
'!mt-1': displayField!.uidt === UITypes.MultiSelect || displayField!.uidt === UITypes.SingleSelect,
}"
>
<LazySmartsheetVirtualCell
v-if="isVirtualCol(displayField)"
v-model="record.row[displayField.title]"
v-if="isVirtualCol(displayField!)"
v-model="record.row[displayField!.title!]"
:column="displayField"
:row="record"
/>
<LazySmartsheetCell
v-else
v-model="record.row[displayField.title]"
v-model="record.row[displayField!.title!]"
:column="displayField"
:edit-enabled="false"
:read-only="true"

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

@ -113,6 +113,8 @@ export class SidebarPage extends BasePage {
} else if (type === ViewTypes.GALLERY) {
createViewTypeButton = this.rootPage.getByTestId('sidebar-view-create-gallery');
} else if (type === ViewTypes.CALENDAR) {
// TODO: Remove this once the easter egg is removed
await this.rootPage.waitForTimeout(4500);
createViewTypeButton = this.rootPage.getByTestId('sidebar-view-create-calendar');
}

1
tests/playwright/tests/db/views/viewCalendar.spec.ts

@ -112,6 +112,7 @@ const dateRecords = [
test.describe('Calendar View', () => {
let dashboard: DashboardPage, toolbar: ToolbarPage, topbar: TopbarPage;
let context: any;
test.skip();
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });

Loading…
Cancel
Save