diff --git a/internal/entity/auth_user_share_test.go b/internal/entity/auth_user_share_test.go index d22152092..00c536190 100644 --- a/internal/entity/auth_user_share_test.go +++ b/internal/entity/auth_user_share_test.go @@ -103,7 +103,7 @@ func TestFindUserShares(t *testing.T) { } func TestUserShare_Create(t *testing.T) { - m := UserShare{} + m := UserShare{UserUID: "uqxc08w3d0ej2283", ShareUID: "as6sg6bxpogaaba7"} err := m.Create() if err != nil { diff --git a/internal/entity/details_test.go b/internal/entity/details_test.go index 707f5bc0f..fc60984ef 100644 --- a/internal/entity/details_test.go +++ b/internal/entity/details_test.go @@ -151,7 +151,7 @@ func TestDetails_Create(t *testing.T) { assert.Error(t, details.Create()) }) t.Run("Success", func(t *testing.T) { - details := Details{PhotoID: 1236799955432} + details := Details{PhotoID: 900000001} err := details.Create() @@ -161,10 +161,9 @@ func TestDetails_Create(t *testing.T) { }) } -// TODO fails on mariadb func TestDetails_Save(t *testing.T) { t.Run("Success", func(t *testing.T) { - details := Details{PhotoID: 123678955432, UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC)} + details := Details{PhotoID: 900000002, UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC)} initialDate := details.UpdatedAt err := details.Save() diff --git a/internal/entity/password_test.go b/internal/entity/password_test.go index cf726a364..844ee4329 100644 --- a/internal/entity/password_test.go +++ b/internal/entity/password_test.go @@ -103,7 +103,7 @@ func TestPassword_Invalid(t *testing.T) { func TestPassword_Create(t *testing.T) { t.Run("Success", func(t *testing.T) { - p := Password{} + p := Password{UID: "uriku0138hqql4bz"} err := p.Create() diff --git a/internal/entity/photo_album_test.go b/internal/entity/photo_album_test.go index db0404ed8..ad834bb9c 100644 --- a/internal/entity/photo_album_test.go +++ b/internal/entity/photo_album_test.go @@ -38,9 +38,8 @@ func TestFirstOrCreatePhotoAlbum(t *testing.T) { t.Errorf("PhotoUID should be the same: %s %s", result.PhotoUID, model.PhotoUID) } }) - //TODO fails on mariadb t.Run("NotYetExistingAlbum", func(t *testing.T) { - model := &PhotoAlbum{} + model := &PhotoAlbum{PhotoUID: "ps6sg6be2lvl0y14", AlbumUID: "as6sg6bipotaab29"} result := FirstOrCreatePhotoAlbum(model) if result == nil { @@ -57,10 +56,9 @@ func TestFirstOrCreatePhotoAlbum(t *testing.T) { }) } -// TODO fails on mariadb func TestPhotoAlbum_Save(t *testing.T) { t.Run("Success", func(t *testing.T) { - p := PhotoAlbum{} + p := PhotoAlbum{PhotoUID: "ps6sg6be2lvl0y14", AlbumUID: "as6sg6bipogaab11"} err := p.Create() diff --git a/internal/entity/photo_label_test.go b/internal/entity/photo_label_test.go index 7cc063a1a..5808c0eb7 100644 --- a/internal/entity/photo_label_test.go +++ b/internal/entity/photo_label_test.go @@ -90,12 +90,11 @@ func TestPhotoLabel_Save(t *testing.T) { t.Fatal(err) } }) - //TODO fails on mariadb t.Run("PhotoNotNilAndLabelNotNil", func(t *testing.T) { label := &Label{LabelName: "LabelSaveUnique", LabelSlug: "unique-slug"} photo := &Photo{} - photoLabel := PhotoLabel{Photo: photo, Label: label} + photoLabel := PhotoLabel{PhotoID: 900000003, LabelID: 900000004, Photo: photo, Label: label} err := photoLabel.Save() if err != nil { t.Fatal(err) diff --git a/internal/entity/subject_test.go b/internal/entity/subject_test.go index 4deb9f8e6..59a9d27de 100644 --- a/internal/entity/subject_test.go +++ b/internal/entity/subject_test.go @@ -302,11 +302,11 @@ func TestSubject_Updates(t *testing.T) { t.Fatal(err) } - if err := m.Updates(Subject{SubjName: "UpdatedName", SubjType: "UpdatedType"}); err != nil { + if err := m.Updates(Subject{SubjName: "UpdatedName", SubjType: "newtype"}); err != nil { t.Fatal(err) } else { assert.Equal(t, "UpdatedName", m.SubjName) - assert.Equal(t, "UpdatedType", m.SubjType) + assert.Equal(t, "newtype", m.SubjType) } })