Tests: Adapt tests to fixture changes

This commit is contained in:
theresa 2021-07-22 13:53:17 +02:00
parent 830fba9d0b
commit dcebf32c2c
4 changed files with 12 additions and 12 deletions

View file

@ -10,7 +10,7 @@ func TestAlbumMap_Get(t *testing.T) {
t.Run("get existing album", func(t *testing.T) {
r := AlbumFixtures.Get("christmas2030")
assert.Equal(t, "at9lxuqxpogaaba7", r.AlbumUID)
assert.Equal(t, "christmas2030", r.AlbumSlug)
assert.Equal(t, "christmas-2030", r.AlbumSlug)
assert.IsType(t, Album{}, r)
})
t.Run("get not existing album", func(t *testing.T) {
@ -24,7 +24,7 @@ func TestAlbumMap_Pointer(t *testing.T) {
t.Run("get existing album pointer", func(t *testing.T) {
r := AlbumFixtures.Pointer("christmas2030")
assert.Equal(t, "at9lxuqxpogaaba7", r.AlbumUID)
assert.Equal(t, "christmas2030", r.AlbumSlug)
assert.Equal(t, "christmas-2030", r.AlbumSlug)
assert.IsType(t, &Album{}, r)
})
t.Run("get not existing album pointer", func(t *testing.T) {

View file

@ -233,7 +233,7 @@ func TestFindAlbumBySlug(t *testing.T) {
t.Fatal("expected to find an album")
}
assert.Equal(t, "Holiday2030", album.AlbumTitle)
assert.Equal(t, "Holiday 2030", album.AlbumTitle)
assert.Equal(t, "holiday-2030", album.AlbumSlug)
})
t.Run("no result", func(t *testing.T) {

View file

@ -39,7 +39,7 @@ func TestAccounts(t *testing.T) {
Query: "",
Share: false,
Sync: false,
Status: "test",
Status: "refresh",
Count: 1001,
Offset: 0,
Order: "",
@ -61,7 +61,7 @@ func TestAccounts(t *testing.T) {
t.Run("find accounts count > max results", func(t *testing.T) {
f := form.AccountSearch{
Query: "",
Status: "test",
Status: "refresh",
Count: 100000,
Offset: 0,
Order: "",

View file

@ -16,7 +16,7 @@ func TestAlbumByUID(t *testing.T) {
t.Fatal(err)
}
assert.Equal(t, "Christmas2030", album.AlbumTitle)
assert.Equal(t, "Christmas 2030", album.AlbumTitle)
})
t.Run("not existing uid", func(t *testing.T) {
@ -84,7 +84,7 @@ func TestAlbumSearch(t *testing.T) {
t.Fatal(err)
}
assert.Equal(t, "Christmas2030", result[0].AlbumTitle)
assert.Equal(t, "Christmas 2030", result[0].AlbumTitle)
})
t.Run("search with slug", func(t *testing.T) {
@ -95,18 +95,18 @@ func TestAlbumSearch(t *testing.T) {
t.Fatal(err)
}
assert.Equal(t, "Holiday2030", result[0].AlbumTitle)
assert.Equal(t, "Holiday 2030", result[0].AlbumTitle)
})
t.Run("search with country", func(t *testing.T) {
query := form.NewAlbumSearch("country:de")
query := form.NewAlbumSearch("country:ca")
result, err := AlbumSearch(query)
if err != nil {
t.Fatal(err)
}
assert.Equal(t, "Berlin 2019", result[0].AlbumTitle)
assert.Equal(t, "April 1990", result[0].AlbumTitle)
})
t.Run("favorites true", func(t *testing.T) {
@ -118,7 +118,7 @@ func TestAlbumSearch(t *testing.T) {
t.Fatal(err)
}
assert.Equal(t, "Holiday2030", result[0].AlbumTitle)
assert.Equal(t, "Holiday 2030", result[0].AlbumTitle)
})
t.Run("empty query", func(t *testing.T) {
query := form.NewAlbumSearch("order:slug")
@ -164,7 +164,7 @@ func TestAlbumSearch(t *testing.T) {
}
assert.Equal(t, 1, len(result))
assert.Equal(t, "christmas2030", result[0].AlbumSlug)
assert.Equal(t, "christmas-2030", result[0].AlbumSlug)
})
t.Run("search with multiple filters", func(t *testing.T) {
f := form.AlbumSearch{