We no longer manage favorites via arbitrary metadata

This commit is contained in:
André Duffeck
2026-03-13 09:38:28 +01:00
parent bfba4ec671
commit cd0831aa10
2 changed files with 40 additions and 4 deletions
+22
View File
@@ -2,6 +2,7 @@ package content_test
import (
"context"
"encoding/json"
storageProvider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
cs3Types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
@@ -86,5 +87,26 @@ var _ = Describe("Basic", func() {
Expect(doc.Mtime).To(Equal(data.expect))
}
})
It("extracts favorites", func() {
favorites := []string{"foo", "bar"}
favBytes, _ := json.Marshal(favorites)
ri := &storageProvider.ResourceInfo{
Opaque: &cs3Types.Opaque{
Map: map[string]*cs3Types.OpaqueEntry{
"favorites": {
Decoder: "json",
Value: favBytes,
},
},
},
}
doc, err := basic.Extract(ctx, ri)
Expect(err).To(BeNil())
Expect(doc).ToNot(BeNil())
Expect(doc.Favorites).To(Equal(favorites))
})
})
})