Skip to content

Commit

Permalink
feature:WEOS-1378
Browse files Browse the repository at this point in the history
- Fixed e2e step
  • Loading branch information
RandyDeo committed Mar 28, 2022
1 parent 7905068 commit 1c4f99e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1813,11 +1813,18 @@ func theFieldShouldHaveTodaysDate(field string) error {

switch dbconfig.Driver {
case "postgres", "mysql":
date := contentEntity[field].(time.Time).Format("2006-01-02")
if !strings.Contains(date, todaysDate) {
return fmt.Errorf("expected the %s date: %s to contain the current date: %s ", field, date, todaysDate)
switch contentEntity[field].(type) {
case *time.Time:
date := contentEntity[field].(*time.Time).Format("2006-01-02")
if !strings.Contains(date, todaysDate) {
return fmt.Errorf("expected the %s date: %s to contain the current date: %s ", field, date, todaysDate)
}
case time.Time:
date := contentEntity[field].(time.Time).Format("2006-01-02")
if !strings.Contains(date, todaysDate) {
return fmt.Errorf("expected the %s date: %s to contain the current date: %s ", field, date, todaysDate)
}
}

case "sqlite3":
if date, ok := contentEntity[field].(*time.Time); ok {
if !strings.Contains(date.Format("2006-01-02"), todaysDate) {
Expand Down

0 comments on commit 1c4f99e

Please sign in to comment.