From 490232a84b9649f071c1c4cf257bede583657ee7 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:12:34 +0530 Subject: [PATCH] fix: timezone playwright test fail issue --- .../playwright/tests/db/features/timezone.spec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/playwright/tests/db/features/timezone.spec.ts b/tests/playwright/tests/db/features/timezone.spec.ts index 9cfb97ba2a..9364eb8b1d 100644 --- a/tests/playwright/tests/db/features/timezone.spec.ts +++ b/tests/playwright/tests/db/features/timezone.spec.ts @@ -1,7 +1,7 @@ import { expect, test } from '@playwright/test'; import { DashboardPage } from '../../../pages/Dashboard'; import setup, { NcContext, unsetup } from '../../../setup'; -import { Api, ProjectListType, UITypes } from 'nocodb-sdk'; +import { Api, PaginatedType, ProjectListType, UITypes } from 'nocodb-sdk'; import { enableQuickRun, isEE, isMysql, isPg, isSqlite } from '../../../setup/db'; import { getKnexConfig } from '../../utils/config'; import { getBrowserTimezoneOffset } from '../../utils/general'; @@ -778,7 +778,11 @@ test.describe.serial('Timezone- ExtDB : DateTime column, Browser Timezone same a // Hence, we skip seconds from API response // - const records = await api.dbTableRow.list('noco', context.base.id, 'MyTable', { limit: 10 }); + const records = (await api.dbTableRow.list('noco', context.base.id, 'MyTable', { limit: 10 })) as { + list: Record[]; + pageInfo: PaginatedType; + }; + records.list = records.list.filter(record => record.DatetimeWithoutTz && record.DatetimeWithTz); let dateTimeWithoutTz = records.list.map(record => record.DatetimeWithoutTz); let dateTimeWithTz = records.list.map(record => record.DatetimeWithTz); @@ -1082,7 +1086,11 @@ test.describe.serial('Timezone- ExtDB (MySQL Only) : DB Timezone configured as H // Hence, we skip seconds from API response // - const records = await api.dbTableRow.list('sakila', context.base.id, 'MyTable', { limit: 10 }); + const records = (await api.dbTableRow.list('sakila', context.base.id, 'MyTable', { limit: 10 })) as { + list: Record[]; + pageInfo: PaginatedType; + }; + records.list = records.list.filter(record => record.DatetimeWithoutTz && record.DatetimeWithTz); let dateTimeWithoutTz = records.list.map(record => record.DatetimeWithoutTz); let dateTimeWithTz = records.list.map(record => record.DatetimeWithTz);