fix @steedos/filters unit test errors

This commit is contained in:
殷亮辉 2022-01-25 03:14:52 +00:00
parent 474d75d0b3
commit ad297b8e9b

View File

@ -7,7 +7,7 @@ describe('format filter and fields to graphql query', () => {
let fields = ["a","a.b.a","x.y","c"];
let result = formatFiltersToGraphqlQuery("contracts", filters, fields);
console.log("graphql filters query result:", result);
expect(result).to.be.include(`((create_date ge 2020-01-01T00:00:00Z) and (create_date le 2020-12-31T23:59:59Z))`);
expect(result).to.be.include(`((create_date ge ${(new Date()).getFullYear()}-01-01T00:00:00Z) and (create_date le ${(new Date()).getFullYear()}-12-31T23:59:59Z))`);
expect(result).to.be.include(" a {");
expect(result).to.be.include(" b {");
expect(result).to.be.include(" x {");
@ -18,7 +18,7 @@ describe('format filter and fields to graphql query', () => {
let fields = "a,a.b.a,x.y,c";
let result = formatFiltersToGraphqlQuery("contracts", filters, fields);
console.log("graphql filters query result:", result);
expect(result).to.be.include(`((create_date ge 2020-01-01T00:00:00Z) and (create_date le 2020-12-31T23:59:59Z))`);
expect(result).to.be.include(`((create_date ge ${(new Date()).getFullYear()}-01-01T00:00:00Z) and (create_date le ${(new Date()).getFullYear()}-12-31T23:59:59Z))`);
expect(result).to.be.include(" a {");
expect(result).to.be.include(" b {");
expect(result).to.be.include(" x {");