Browse Source

Test: Sqlite timezone corrections

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5642/head
Raju Udava 1 year ago
parent
commit
d12eb63567
  1. 10
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 14
      tests/playwright/tests/db/timezone.spec.ts

10
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -360,4 +360,12 @@ export class CellPageObject extends BasePage {
await this.get({ index, columnHeader }).press((await this.isMacOs()) ? 'Meta+C' : 'Control+C');
await this.verifyToast({ message: 'Copied to clipboard' });
}
}
async pasteFromClipboard({ index, columnHeader }: CellProps, ...clickOptions: Parameters<Locator['click']>) {
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
await this.get({ index, columnHeader }).click(...clickOptions);
await (await this.get({ index, columnHeader }).elementHandle()).waitForElementState('stable');
await this.get({ index, columnHeader }).press((await this.isMacOs()) ? 'Meta+V' : 'Control+V');
}
}

14
tests/playwright/tests/db/timezone.spec.ts

@ -480,8 +480,14 @@ test.describe('External DB - DateTime column', async () => {
// without +HH:MM information, display value is same as inserted value
// with +HH:MM information, display value is converted to browser timezone
// SQLite doesn't have with & without timezone fields; both are same in this case
DatetimeWithoutTz: ['2023-04-27 10:00', getDateTimeInLocalTimeZone('2023-04-27 04:30:00+00:00')],
DatetimeWithTz: ['2023-04-27 10:00', getDateTimeInLocalTimeZone('2023-04-27 04:30:00+00:00')],
DatetimeWithoutTz: [
getDateTimeInLocalTimeZone('2023-04-27 10:00:00+00:00'),
getDateTimeInLocalTimeZone('2023-04-27 04:30:00+00:00'),
],
DatetimeWithTz: [
getDateTimeInLocalTimeZone('2023-04-27 10:00:00+00:00'),
getDateTimeInLocalTimeZone('2023-04-27 04:30:00+00:00'),
],
},
mysql: {
DatetimeWithoutTz: [
@ -629,12 +635,12 @@ test.describe('External DB - DateTime column', async () => {
if (isSqlite(context)) {
expectedDateTimeWithoutTz = [
'2023-04-27 10:00:00',
'2023-04-27 10:00:00+00:00',
'2023-04-27 10:00:00+05:30',
getDateTimeInUTCTimeZone('2023-04-27 10:00:00+00:00'),
];
expectedDateTimeWithTz = [
'2023-04-27 10:00:00',
'2023-04-27 10:00:00+00:00',
'2023-04-27 10:00:00+05:30',
getDateTimeInUTCTimeZone('2023-04-27 10:00:00+00:00'),
];

Loading…
Cancel
Save