From e0699acc4e2954fcf5367a05320f2bea1ffc4087 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 18 Jul 2022 18:41:43 +0800 Subject: [PATCH] cypress: fix weekday test --- .../cypress/integration/common/3b_formula_column.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/cypress/integration/common/3b_formula_column.js b/scripts/cypress/integration/common/3b_formula_column.js index c7bab052c4..d8251535a7 100644 --- a/scripts/cypress/integration/common/3b_formula_column.js +++ b/scripts/cypress/integration/common/3b_formula_column.js @@ -153,6 +153,8 @@ export const genTest = (apiType, dbType) => { let RESULT_MATH_0 = []; let RESULT_MATH_1 = []; let RESULT_MATH_2 = []; + let RESULT_WEEKDAY_0 = []; + let RESULT_WEEKDAY_1 = []; for (let i = 0; i < 10; i++) { // CONCAT, LOWER, UPPER, TRIM @@ -184,6 +186,11 @@ export const genTest = (apiType, dbType) => { Math.pow(cityId[i], 3) + Math.sqrt(countryId[i]) ); + + // WEEKDAY: starts from Monday + RESULT_WEEKDAY_0[i] = 1; + // WEEKDAY: starts from Sunday + RESULT_WEEKDAY_1[i] = 2; } it("Formula: ADD, AVG, LEN", () => { @@ -200,14 +207,14 @@ export const genTest = (apiType, dbType) => { "NC_WEEKDAY_0", `WEEKDAY("2022-07-19")` ); - rowValidation("NC_WEEKDAY_0", 1); + rowValidation("NC_WEEKDAY_0", RESULT_WEEKDAY_0); editColumnByName( "NC_WEEKDAY_0", "NC_WEEKDAY_1", `WEEKDAY("2022-07-19", "sunday")` ); - rowValidation("NC_WEEKDAY_1", 2); + rowValidation("NC_WEEKDAY_1", RESULT_WEEKDAY_1); }); it("Formula: CONCAT, LOWER, UPPER, TRIM", () => {