Browse Source

feat(playwrights): add DATETIME_DIFF tests

pull/4821/head
Wing-Kam Wong 2 years ago
parent
commit
b061a1b99e
  1. 16
      tests/playwright/tests/columnFormula.spec.ts

16
tests/playwright/tests/columnFormula.spec.ts

@ -38,6 +38,10 @@ const formulaDataByDbType = (context: NcContext) => [
formula: `DATETIME_DIFF("2022/10/14", "2022/10/15", "minutes")`,
result: ['-1440', '-1440', '-1440', '-1440', '-1440'],
},
{
formula: `DATETIME_DIFF("2023/10/14", "2023/01/13", "minutes")`,
result: ['394560', '394560', '394560', '394560', '394560'],
},
{
formula: `DATETIME_DIFF("2022/10/14", "2022/10/15", "seconds")`,
result: ['-86400', '-86400', '-86400', '-86400', '-86400'],
@ -74,6 +78,18 @@ const formulaDataByDbType = (context: NcContext) => [
formula: `DATETIME_DIFF("2023/10/14", NOW(), "y")`,
result: ['0', '0', '0', '0', '0'],
},
{
formula: `DATETIME_DIFF("2023-01-12", "2021-08-29", "y")`,
result: ['1', '1', '1', '1', '1'],
},
{
formula: `DATETIME_DIFF("2021-01-12", "2026-01-29", "y")`,
result: ['-5', '-5', '-5', '-5', '-5'],
},
{
formula: `DATETIME_DIFF("1990-01-12", "2046-12-29", "y")`,
result: ['-56', '-56', '-56', '-56', '-56'],
},
{
formula: `DATETIME_DIFF("2022/10/14", "2023/10/14", "d")`,
result: ['-365', '-365', '-365', '-365', '-365'],

Loading…
Cancel
Save