mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 13:38:15 -08:00
fix: import tests get listens from all time
This commit is contained in:
parent
e4122ee961
commit
42cda0b1d6
1 changed files with 4 additions and 3 deletions
|
|
@ -110,9 +110,10 @@ func TestImportLastFM(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
track, err := store.GetTrack(context.Background(), db.GetTrackOpts{Title: "because I'm stupid?", ArtistIDs: []int32{artist.ID}})
|
||||
require.NoError(t, err)
|
||||
listens, err := store.GetListensPaginated(context.Background(), db.GetItemsOpts{TrackID: int(track.ID)})
|
||||
t.Log(track)
|
||||
listens, err := store.GetListensPaginated(context.Background(), db.GetItemsOpts{TrackID: int(track.ID), Period: db.PeriodAllTime})
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, listens.Items, 1)
|
||||
require.Len(t, listens.Items, 1)
|
||||
assert.WithinDuration(t, time.Unix(1749776100, 0), listens.Items[0].Time, 1*time.Second)
|
||||
|
||||
truncateTestData(t)
|
||||
|
|
@ -180,7 +181,7 @@ func TestImportListenBrainz(t *testing.T) {
|
|||
track, err := store.GetTrack(context.Background(), db.GetTrackOpts{MusicBrainzID: uuid.MustParse("08e8f55b-f1a4-46b8-b2d1-fab4c592165c")})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "Desert", track.Title)
|
||||
listens, err := store.GetListensPaginated(context.Background(), db.GetItemsOpts{TrackID: int(track.ID)})
|
||||
listens, err := store.GetListensPaginated(context.Background(), db.GetItemsOpts{TrackID: int(track.ID), Period: db.PeriodAllTime})
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, listens.Items, 1)
|
||||
assert.WithinDuration(t, time.Unix(1749780612, 0), listens.Items[0].Time, 1*time.Second)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue