Browse Source

test: fix playwright test

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
1a78881f97
  1. 4
      packages/nc-gui/composables/useCalendarViewStore.ts
  2. 9
      tests/playwright/tests/db/views/viewCalendar.spec.ts

4
packages/nc-gui/composables/useCalendarViewStore.ts

@ -202,8 +202,8 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
nextDate = selectedDate.value.add(1, 'day').startOf('day')
break
case 'selectedHours':
fromDate = selectedTime.value?.startOf('hour')
toDate = selectedTime.value?.endOf('hour')
fromDate = (selectedTime.value ?? dayjs()).startOf('hour')
toDate = (selectedTime.value ?? dayjs()).endOf('hour')
prevDate = fromDate?.subtract(1, 'hour').endOf('hour')
nextDate = toDate?.add(1, 'hour').startOf('hour')
break

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

@ -298,6 +298,7 @@ test.describe('View', () => {
await calendar.calendarMonth.dragAndDrop({
record: 'Team Catchup',
to: {
columnIndex: 3,
rowIndex: 0,
@ -324,13 +325,13 @@ test.describe('View', () => {
record: 'Team Catchup',
to: {
dayIndex: 0,
hourIndex: 10,
hourIndex: 5,
},
});
await calendar.sideMenu.updateFilter({ filter: 'In selected hours' });
await calendar.calendarWeekDateTime.selectHour({ dayIndex: 0, hourIndex: 10 });
await calendar.calendarWeekDateTime.selectHour({ dayIndex: 0, hourIndex: 5 });
await calendar.sideMenu.verifySideBarRecords({ records: ['Team Catchup'] });
@ -340,10 +341,10 @@ test.describe('View', () => {
await calendar.calendarDayDateTime.dragAndDrop({
record: 'Team Catchup',
hourIndex: 5,
hourIndex: 3,
});
await calendar.calendarDayDateTime.selectHour({ hourIndex: 5 });
await calendar.calendarDayDateTime.selectHour({ hourIndex: 3 });
await calendar.sideMenu.updateFilter({ filter: 'In selected hours' });

Loading…
Cancel
Save