Skip to content

Commit

Permalink
website/admin: fix pending tests failing due to ReviewedAt being set …
Browse files Browse the repository at this point in the history
…again
  • Loading branch information
Wessie committed Feb 25, 2024
1 parent 119b86c commit a992d68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions website/admin/pending_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ func TestPostPending(t *testing.T) {
assert.Error(t, err)
// we shouldn't have an accepted song after a rollback
assert.Nil(t, form.AcceptedSong)
// the form is updated with a ReviewedAt field when it passes through
// parsing but we don't have the exact value so we swap it over to the
// "input" form before comparing.
formWeSend.ReviewedAt = form.ReviewedAt
// check if we have an expected form return value
if test.ExpectedForm == nil {
// if not try the form we send over the wire
Expand Down Expand Up @@ -325,6 +329,10 @@ func TestPendingFormRoundTrip(t *testing.T) {

out.Update(in.ToValues())

// ReviewedAt is set to Now on Update so copy that over to our in
// so we can actually compare them
in.ReviewedAt = out.ReviewedAt

return out.PendingSong == in.PendingSong
}, pendingSongGen,
))
Expand Down

0 comments on commit a992d68

Please sign in to comment.