Skip to content

Commit

Permalink
fixed a test impacted by the UpdateAssetLastSeen method
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Aug 27, 2024
1 parent 5574f7c commit ba7cec2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions repository/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,15 @@ func TestLastSeenUpdates(t *testing.T) {

a2, err := store.CreateAsset(asset)
assert.NoError(t, err)

assert.Equal(t, a1.ID, a2.ID)
// assert.NotEqual(t, time.Time{}, a1.CreatedAt)
assert.Equal(t, a1.CreatedAt, a2.CreatedAt)
if a2.LastSeen.UnixNano() <= a1.LastSeen.UnixNano() {
t.Errorf("a2.LastSeen: %s, a1.LastSeen: %s", a2.LastSeen.Format(time.RFC3339Nano), a1.LastSeen.Format(time.RFC3339Nano))
assert.Equal(t, a1.LastSeen, a2.LastSeen)

store.UpdateAssetLastSeen(a1.ID)
a3, err := store.CreateAsset(asset)
assert.NoError(t, err)
if a3.LastSeen.UnixNano() <= a1.LastSeen.UnixNano() {
t.Errorf("a3.LastSeen: %s, a1.LastSeen: %s", a2.LastSeen.Format(time.RFC3339Nano), a1.LastSeen.Format(time.RFC3339Nano))
}
}

Expand Down

0 comments on commit ba7cec2

Please sign in to comment.