From b65789da77fc26274ae1e04a5bf7868a7039dd6d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 12 Jan 2023 12:34:32 +0800 Subject: [PATCH] feat(playwright): add NOW() tests for datetime diff formula --- tests/playwright/tests/columnFormula.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/playwright/tests/columnFormula.spec.ts b/tests/playwright/tests/columnFormula.spec.ts index bc08da00ba..650d9501a4 100644 --- a/tests/playwright/tests/columnFormula.spec.ts +++ b/tests/playwright/tests/columnFormula.spec.ts @@ -66,10 +66,22 @@ const formulaDataByDbType = (context: NcContext) => [ formula: `DATETIME_DIFF("2022/10/14", "2023/10/14", "y")`, result: ['-1', '-1', '-1', '-1', '-1'], }, + { + formula: `DATETIME_DIFF(NOW(), "2023/10/14", "y")`, + result: ['-1', '-1', '-1', '-1', '-1'], + }, + { + formula: `DATETIME_DIFF("2022/10/14", NOW(), "y")`, + result: ['0', '0', '0', '0', '0'], + }, { formula: `DATETIME_DIFF("2022/10/14", "2023/10/14", "d")`, result: ['-365', '-365', '-365', '-365', '-365'], }, + { + formula: `DATETIME_DIFF("2022/10/14", NOW(), "d")`, + result: ['-90', '-90', '-90', '-90', '-90'], + }, { formula: `CONCAT(UPPER({City}), LOWER({City}), TRIM(' trimmed '))`, result: [