From b3d88df78b633f1b097a3ff274206e8b1f44ba26 Mon Sep 17 00:00:00 2001 From: Tillman Jex Date: Tue, 19 Nov 2024 10:14:51 +0100 Subject: [PATCH] fix test. Set current day one month in advance (#467) --- internal/adapter/handlebars/handlebars_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/adapter/handlebars/handlebars_test.go b/internal/adapter/handlebars/handlebars_test.go index 558c2529..975a3c5d 100644 --- a/internal/adapter/handlebars/handlebars_test.go +++ b/internal/adapter/handlebars/handlebars_test.go @@ -242,7 +242,9 @@ func TestFormatDateHelper(t *testing.T) { func TestFormatDateHelperElapsedYear(t *testing.T) { year := time.Now().UTC().Year() - 14 - context := map[string]interface{}{"now": time.Date(year, 11, 17, 20, 34, 58, 651387237, time.UTC)} + month := time.Now().UTC().Month() + 1 + day := time.Now().UTC().Day() + context := map[string]interface{}{"now": time.Date(year, month, day, 20, 34, 58, 651387237, time.UTC)} testString(t, "{{format-date now 'elapsed'}}", context, "14 years ago") }