From 3ff00c65c5bdc10eb501f89120266e80dc985b22 Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Mon, 28 Mar 2022 11:17:52 +0200 Subject: [PATCH] Tests: Add album fixtures --- internal/entity/album_fixtures.go | 150 ++++++++++++++++++++++++ internal/entity/photo_album_fixtures.go | 66 +++++++++++ 2 files changed, 216 insertions(+) diff --git a/internal/entity/album_fixtures.go b/internal/entity/album_fixtures.go index df0c26985..072b813a9 100644 --- a/internal/entity/album_fixtures.go +++ b/internal/entity/album_fixtures.go @@ -293,6 +293,156 @@ var AlbumFixtures = AlbumMap{ UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), DeletedAt: nil, }, + "&ilikefood": { + ID: 1000011, + AlbumUID: "at1lxuqipotaab19", + AlbumSlug: "&ilikefood", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "&IlikeFood", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, + "i-love-%-dog": { + ID: 1000012, + AlbumUID: "at1lxuqipotaab20", + AlbumSlug: "i-love-%-dog", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "I love % dog", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, + "%gold": { + ID: 1000013, + AlbumUID: "at1lxuqipotaab21", + AlbumSlug: "%gold", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "%gold", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, + "sale%": { + ID: 1000014, + AlbumUID: "at1lxuqipotaab22", + AlbumSlug: "sale%", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "sale%", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, + "pets&dogs": { + ID: 1000015, + AlbumUID: "at1lxuqipotaab23", + AlbumSlug: "pest&dogs", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "Pets & Dogs", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, + "light&": { + ID: 1000016, + AlbumUID: "at1lxuqipotaab24", + AlbumSlug: "light&", + AlbumPath: "", + AlbumType: AlbumDefault, + AlbumTitle: "Light&", + AlbumLocation: "", + AlbumCategory: "", + AlbumCaption: "", + AlbumDescription: "", + AlbumNotes: "", + AlbumFilter: "", + AlbumOrder: "name", + AlbumTemplate: "", + AlbumCountry: "zz", + AlbumYear: 0, + AlbumMonth: 0, + AlbumDay: 0, + AlbumFavorite: false, + AlbumPrivate: false, + CreatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), + UpdatedAt: time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC), + DeletedAt: nil, + }, } // CreateAlbumFixtures inserts known entities into the database for testing. diff --git a/internal/entity/photo_album_fixtures.go b/internal/entity/photo_album_fixtures.go index abe1b0b39..f9500a3b3 100644 --- a/internal/entity/photo_album_fixtures.go +++ b/internal/entity/photo_album_fixtures.go @@ -109,6 +109,72 @@ var PhotoAlbumFixtures = PhotoAlbumMap{ Photo: PhotoFixtures.Pointer("Photo14"), Album: AlbumFixtures.Pointer("berlin-2019"), }, + "9": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab24", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("light&"), + }, + "10": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab23", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("pets&dogs"), + }, + "11": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab19", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("&ilikefood"), + }, + "12": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab22", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("sale%"), + }, + "13": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab21", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("%gold"), + }, + "14": { + PhotoUID: "pt9jtdre2lvl0yh0", + AlbumUID: "at1lxuqipotaab20", + Hidden: false, + Missing: false, + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: PhotoFixtures.Pointer("Photo03"), + Album: AlbumFixtures.Pointer("i-love-%-dog"), + }, } // CreatePhotoAlbumFixtures inserts known entities into the database for testing.