refac: stale test entries, failing web tests, Postgre backup bug, Hardcoded MySQL table count, Stale Postgre connection in test, own-scope visibility filter, GetAll ignoring its error, JSON tags in use-case types, 31 copies of DESKTOP_QUERY, ProfileView endpoint paths

This commit is contained in:
Florian Sylvain committed 2026-10-28 17:54:10 +01:00
1 parent efecdee200
commit 5d6f378fce
87 files changed
+696 -373

No files matched your search

+6 -6
View File
@@ -165,20 +165,20 @@ func TestArticleRepositoryWritesOnSQLite(t *testing.T) {
}
}
if all := repo.GetAll(); len(all) != 2 {
if all := allOf(repo.GetAll()); len(all) != 2 {
t.Errorf("articles = %+v", all)
}
})
t.Run("GetAll returns an empty list when the query fails", func(t *testing.T) {
t.Run("GetAll returns the error when the query fails", func(t *testing.T) {
repo, db, _ := setup(t)
fault := injectDatabaseFault(db, "fault:getall", faultOnQuery)
fault.armed.Store(true)
all := repo.GetAll()
all, err := repo.GetAll()
if all == nil || len(all) != 0 {
t.Errorf("articles = %#v", all)
if err == nil || len(all) != 0 {
t.Errorf("articles = %#v, err = %v", all, err)
}
})
@@ -436,7 +436,7 @@ func TestSiteDeletionIsCheckedInsideTheTransaction(t *testing.T) {
_, updateErr := articles.Update(created.ID, article.Update{SiteID: &shop.ID})
unchanged, _ := articles.Get(created.ID)
if !errors.Is(createErr, site.ErrSiteNotFound) || !errors.Is(updateErr, site.ErrSiteNotFound) || unchanged.SiteID != blog.ID || len(articles.GetAll()) != 1 {
if !errors.Is(createErr, site.ErrSiteNotFound) || !errors.Is(updateErr, site.ErrSiteNotFound) || unchanged.SiteID != blog.ID || len(allOf(articles.GetAll())) != 1 {
t.Errorf("create %v, update %v, site %d", createErr, updateErr, unchanged.SiteID)
}
})