test(persistence): drop two artwork-queue specs that cannot fail

One seeded hash and source together and then asserted the two counts agree,
so its setup guaranteed the result; the other repeated the count-does-not-
enqueue property already covered by the CountBySource spec.
This commit is contained in:
Deluan 2026-08-14 15:23:05 -04:00
commit 3a76a24dab

View file

@ -415,35 +415,8 @@ var _ = Describe("ArtworkQueueRepository", func() {
To(Equal(model.ArtworkAbsentStat{Total: 2, Stale: 1}))
})
// status prints both under one "absent" heading, so a writer that stops clearing hash and
// source together would make the two numbers disagree with no other warning.
It("agrees with the source-based absent count", func() {
awRepo := NewArtworkRepository(context.Background(), GetDBXBuilder())
for _, ia := range []model.ItemArtwork{
{ItemKind: "ar", ItemID: "absent1", ImageType: model.ImageTypePrimary, Hash: "", Source: "", AttemptedAt: time.Now()},
{ItemKind: "ar", ItemID: "absent2", ImageType: model.ImageTypePrimary, Hash: "", Source: "", AttemptedAt: time.Now()},
{ItemKind: "ar", ItemID: "found1", ImageType: model.ImageTypePrimary, Hash: "hX", Source: "folder", AttemptedAt: time.Now()},
} {
Expect(awRepo.PutItemArtwork(&ia)).To(Succeed())
}
stat, err := repo.CountAbsent(model.KindArtistArtwork, time.Now())
Expect(err).ToNot(HaveOccurred())
Expect(repo.CountBySource(model.KindArtistArtwork, []string{""})).To(Equal(stat.Total))
})
It("reports a kind with no absent state as zero, not as an error", func() {
Expect(repo.CountAbsent(model.KindRadioArtwork, time.Now())).To(Equal(model.ArtworkAbsentStat{}))
})
It("counts without enqueueing", func() {
awRepo := NewArtworkRepository(context.Background(), GetDBXBuilder())
Expect(awRepo.PutItemArtwork(&model.ItemArtwork{ItemKind: "ar", ItemID: "ar9",
ImageType: model.ImageTypePrimary, Hash: "", AttemptedAt: time.Now()})).To(Succeed())
_, err := repo.CountAbsent(model.KindArtistArtwork, time.Now())
Expect(err).ToNot(HaveOccurred())
Expect(repo.Count()).To(BeZero())
})
})
})