fix: update watchlist service tests
This commit is contained in:
@@ -35,14 +35,14 @@ type SkipSegment struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WatchPageData struct {
|
type WatchPageData struct {
|
||||||
MalID int
|
MalID int
|
||||||
Title string
|
Title string
|
||||||
CurrentEpisode string
|
CurrentEpisode string
|
||||||
StartTimeSeconds float64
|
StartTimeSeconds float64
|
||||||
CurrentStatus string
|
CurrentStatus string
|
||||||
InitialMode string
|
InitialMode string
|
||||||
AvailableModes []string
|
AvailableModes []string
|
||||||
ModeSources map[string]ModeSource
|
ModeSources map[string]ModeSource
|
||||||
Segments []SkipSegment
|
Segments []SkipSegment
|
||||||
FallbackEpisodes map[string]int
|
FallbackEpisodes map[string]int
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,9 @@ func TestAddEntry_RejectsInvalidAnimeID(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
q := &fakeQuerier{}
|
q := &fakeQuerier{}
|
||||||
svc := NewService(q, nil)
|
svc := NewService(q, nil, nil)
|
||||||
|
|
||||||
err := svc.AddEntry(context.Background(), "user-1", AddRequest{
|
err := svc.AddToWatchlist(context.Background(), "user-1", 0, "watching")
|
||||||
AnimeID: 0,
|
|
||||||
Status: "watching",
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != ErrInvalidAnimeID {
|
if err != ErrInvalidAnimeID {
|
||||||
t.Fatalf("expected ErrInvalidAnimeID, got %v", err)
|
t.Fatalf("expected ErrInvalidAnimeID, got %v", err)
|
||||||
@@ -52,12 +49,9 @@ func TestAddEntry_RejectsInvalidStatus(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
q := &fakeQuerier{}
|
q := &fakeQuerier{}
|
||||||
svc := NewService(q, nil)
|
svc := NewService(q, nil, nil)
|
||||||
|
|
||||||
err := svc.AddEntry(context.Background(), "user-1", AddRequest{
|
err := svc.AddToWatchlist(context.Background(), "user-1", 1, "invalid")
|
||||||
AnimeID: 1,
|
|
||||||
Status: "invalid",
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != ErrInvalidStatus {
|
if err != ErrInvalidStatus {
|
||||||
t.Fatalf("expected ErrInvalidStatus, got %v", err)
|
t.Fatalf("expected ErrInvalidStatus, got %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user