From 3a3d7c37c25f2c798bb564f7379ca9aca87268cb Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 20 Feb 2024 07:16:19 +0000 Subject: [PATCH] feat(nc-gui): playwright tests --- .../nc-gui/components/nc/DateWeekSelector.vue | 1 + .../smartsheet/calendar/DayView/DateField.vue | 1 + .../calendar/DayView/DateTimeField.vue | 4 +- .../smartsheet/calendar/MonthView.vue | 8 +- .../smartsheet/calendar/SideMenu.vue | 8 +- .../smartsheet/calendar/YearView.vue | 6 +- .../components/smartsheet/calendar/index.vue | 5 +- .../composables/useCalendarViewStore.ts | 2 +- .../Dashboard/Calendar/CalendarDayDateTime.ts | 46 +++ .../pages/Dashboard/Calendar/CalendarMonth.ts | 46 +++ .../Dashboard/Calendar/CalendarSideMenu.ts | 38 ++ .../Dashboard/Calendar/CalendarTopBar.ts | 22 +- .../pages/Dashboard/Calendar/CalendarYear.ts | 26 ++ .../pages/Dashboard/Calendar/index.ts | 25 +- .../pages/Dashboard/Sidebar/index.ts | 2 + .../Dashboard/common/Toolbar/CalendarRange.ts | 21 +- .../pages/Dashboard/common/Toolbar/index.ts | 13 + .../tests/db/views/viewCalendar.spec.ts | 330 +++++++++++------- 18 files changed, 460 insertions(+), 144 deletions(-) create mode 100644 tests/playwright/pages/Dashboard/Calendar/CalendarDayDateTime.ts create mode 100644 tests/playwright/pages/Dashboard/Calendar/CalendarMonth.ts create mode 100644 tests/playwright/pages/Dashboard/Calendar/CalendarSideMenu.ts create mode 100644 tests/playwright/pages/Dashboard/Calendar/CalendarYear.ts diff --git a/packages/nc-gui/components/nc/DateWeekSelector.vue b/packages/nc-gui/components/nc/DateWeekSelector.vue index 04f8a2edee..0e3a1446bd 100644 --- a/packages/nc-gui/components/nc/DateWeekSelector.vue +++ b/packages/nc-gui/components/nc/DateWeekSelector.vue @@ -180,6 +180,7 @@ const paginate = (action: 'next' | 'prev') => { 'rounded-md bg-brand-50 text-brand-500': isSameDate(date, dayjs()) && isDateInCurrentMonth(date), }" class="h-9 w-9 px-1 py-2 relative font-medium flex items-center cursor-pointer justify-center" + data-testid="nc-calendar-date" @click="handleSelectDate(date)" > diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue index 7e0e6ad519..eeaae6dd3d 100644 --- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue +++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue @@ -180,6 +180,7 @@ const dropEvent = (event: DragEvent) => {
{
{
-
+
{ - + @@ -343,12 +344,14 @@ onUnmounted(() => { 'h-[calc(100vh-25.1rem)]': activeCalendarView === ('month' as const) || activeCalendarView === ('year' as const) && height > 918, }" class="gap-2 flex flex-col nc-scrollbar-md overflow-y-auto nc-calendar-top-height" + data-testid="nc-calendar-side-menu-list" @scroll="sideBarListScrollHandle" > @@ -389,6 +392,7 @@ onUnmounted(() => { : null " color="blue" + data-testid="nc-sidebar-record-card" @click="emit('expand-record', record)" @dragstart="dragStart($event, record)" @dragover.prevent diff --git a/packages/nc-gui/components/smartsheet/calendar/YearView.vue b/packages/nc-gui/components/smartsheet/calendar/YearView.vue index 6a747f61bc..6684ab27af 100644 --- a/packages/nc-gui/components/smartsheet/calendar/YearView.vue +++ b/packages/nc-gui/components/smartsheet/calendar/YearView.vue @@ -11,7 +11,10 @@ const months = computed(() => {