API: Add additional fields to label and subject edit forms #383 #3168

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-01-17 02:55:07 +01:00
parent d786a8225d
commit 0ada8d1095
99 changed files with 1241 additions and 1101 deletions

View File

@@ -32,21 +32,21 @@ func TestSelection_Empty(t *testing.T) {
assert.Equal(t, false, sel.Empty())
assert.Equal(t, []string{"jqzkpo13j8ngpgv4", "jqzkq8j10hj39sxp"}, sel.Subjects)
})
t.Run("empty", func(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
sel := Selection{Photos: []string{}, Albums: []string{}, Labels: []string{}}
assert.Equal(t, true, sel.Empty())
})
}
func TestSelection_Get(t *testing.T) {
t.Run("success", func(t *testing.T) {
t.Run("Success", func(t *testing.T) {
sel := Selection{Photos: []string{"p123", "p456"}, Albums: []string{"a123"}, Labels: []string{"l123", "l456", "l789"}, Files: []string{"f567", "f111"}, Places: []string{"p568"}, Subjects: []string{"jqzkpo13j8ngpgv4"}}
assert.Equal(t, []string{"p123", "p456", "a123", "l123", "l456", "l789", "p568", "jqzkpo13j8ngpgv4"}, sel.Get())
})
}
func TestSelection_String(t *testing.T) {
t.Run("success", func(t *testing.T) {
t.Run("Success", func(t *testing.T) {
sel := Selection{Photos: []string{"p123", "p456"}, Albums: []string{"a123"}, Labels: []string{"l123", "l456", "l789"}, Files: []string{"f567", "f111"}, Places: []string{"p568"}}
assert.Equal(t, "p123, p456, a123, l123, l456, l789, p568", sel.String())
})