From ad297b8e9b609fbffdfaf360e98ff5338fafc076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B7=E4=BA=AE=E8=BE=89?= Date: Tue, 25 Jan 2022 03:14:52 +0000 Subject: [PATCH] fix @steedos/filters unit test errors --- packages/filters/test/unit/format_graphql.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/filters/test/unit/format_graphql.js b/packages/filters/test/unit/format_graphql.js index 019d452000..956d256285 100644 --- a/packages/filters/test/unit/format_graphql.js +++ b/packages/filters/test/unit/format_graphql.js @@ -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 {");