Browse Source

test: tz handling fix for mysql

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5306/head
Raju Udava 2 years ago
parent
commit
d68defdc72
  1. 4
      tests/playwright/setup/xcdb-records.ts
  2. 2
      tests/playwright/tests/filters.spec.ts

4
tests/playwright/setup/xcdb-records.ts

@ -1,6 +1,6 @@
import { ColumnType, UITypes } from 'nocodb-sdk';
const rowMixedValue = (column: ColumnType, index: number) => {
const rowMixedValue = (column: ColumnType, index: number, db?: string) => {
// Array of country names
const countries = [
'Afghanistan',
@ -39,7 +39,7 @@ const rowMixedValue = (column: ColumnType, index: number) => {
// compute timezone offset
const offset = new Date().getTimezoneOffset();
const timezoneOffset =
(offset <= 0 ? '+' : '-') +
(db === 'mysql' ? (offset < 0 ? '+' : '-') : offset <= 0 ? '+' : '-') +
String(Math.abs(Math.round(offset / 60))).padStart(2, '0') +
':' +
String(Math.abs(offset % 60)).padStart(2, '0');

2
tests/playwright/tests/filters.spec.ts

@ -294,7 +294,7 @@ test.describe('Filter Tests: Numerical', () => {
Duration: rowMixedValue(columns[5], i),
Rating: rowMixedValue(columns[6], i),
Year: rowMixedValue(columns[7], i),
Time: rowMixedValue(columns[8], i),
Time: rowMixedValue(columns[8], i, context.dbType),
};
rowAttributes.push(row);
}

Loading…
Cancel
Save