Browse Source

cypress: fix weekday test

pull/2706/head
Wing-Kam Wong 2 years ago
parent
commit
e0699acc4e
  1. 11
      scripts/cypress/integration/common/3b_formula_column.js

11
scripts/cypress/integration/common/3b_formula_column.js

@ -153,6 +153,8 @@ export const genTest = (apiType, dbType) => {
let RESULT_MATH_0 = []; let RESULT_MATH_0 = [];
let RESULT_MATH_1 = []; let RESULT_MATH_1 = [];
let RESULT_MATH_2 = []; let RESULT_MATH_2 = [];
let RESULT_WEEKDAY_0 = [];
let RESULT_WEEKDAY_1 = [];
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
// CONCAT, LOWER, UPPER, TRIM // CONCAT, LOWER, UPPER, TRIM
@ -184,6 +186,11 @@ export const genTest = (apiType, dbType) => {
Math.pow(cityId[i], 3) + Math.pow(cityId[i], 3) +
Math.sqrt(countryId[i]) 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", () => { it("Formula: ADD, AVG, LEN", () => {
@ -200,14 +207,14 @@ export const genTest = (apiType, dbType) => {
"NC_WEEKDAY_0", "NC_WEEKDAY_0",
`WEEKDAY("2022-07-19")` `WEEKDAY("2022-07-19")`
); );
rowValidation("NC_WEEKDAY_0", 1); rowValidation("NC_WEEKDAY_0", RESULT_WEEKDAY_0);
editColumnByName( editColumnByName(
"NC_WEEKDAY_0", "NC_WEEKDAY_0",
"NC_WEEKDAY_1", "NC_WEEKDAY_1",
`WEEKDAY("2022-07-19", "sunday")` `WEEKDAY("2022-07-19", "sunday")`
); );
rowValidation("NC_WEEKDAY_1", 2); rowValidation("NC_WEEKDAY_1", RESULT_WEEKDAY_1);
}); });
it("Formula: CONCAT, LOWER, UPPER, TRIM", () => { it("Formula: CONCAT, LOWER, UPPER, TRIM", () => {

Loading…
Cancel
Save