feat(uploads): preview storage paths, detect templates, attach covers and withdraw batches
ci / module boundaries / boundaries (push) Successful in 7s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 55s
ci / ts / ts (packages + web) (push) Failing after 4m4s
ci / api / api (push) Successful in 55s
ci / db / db (push) Failing after 1m14s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m11s

This commit is contained in:
mrleo1nid committed 2026-10-29 10:28:29 +03:00
1 parent 5e2d1e902b
commit 64dd8ed05e
29 files changed
+1219 -471

No files matched your search

@@ -182,6 +182,26 @@ func TestExtFor(t *testing.T) {
}
}
func TestInitialAlbumCover(t *testing.T) {
s := &Service{cfg: Config{StagingDir: t.TempDir()}}
if cover, err := s.createCover(nil); err != nil || cover != nil {
t.Fatalf("missing cover = %v, %v", cover, err)
}
if _, err := s.createCover([]byte("not an image")); err == nil {
t.Fatal("invalid cover must be rejected")
}
data := []byte{0xff, 0xd8, 0xff, 1}
rel, err := s.createCover(data)
require.NoError(t, err)
require.NotNil(t, rel)
got, err := os.ReadFile(s.stagingAbs(*rel))
require.NoError(t, err)
assert.Equal(t, data, got)
second, err := s.createCover(data)
require.NoError(t, err)
assert.NotEqual(t, *rel, *second, "album batches must not overwrite each other's cover")
}
func TestReuseExistingFolders(t *testing.T) {
root := t.TempDir()
require.NoError(t, os.MkdirAll(filepath.Join(root, "Кино", "1988 - Группа крови"), 0o755))