Add/improve e2e test cases

This commit is contained in:
Tobias Gesellchen
2026-04-04 18:53:59 +02:00
parent cc92430e69
commit c1e7d513b4
12 changed files with 188 additions and 46 deletions
+1 -5
View File
@@ -229,10 +229,6 @@ type RecentItemParity struct {
Source *RecentItemParitySource `xml:"source,omitempty"`
SourceID string `xml:"sourceid"`
UpdatedOn string `xml:"updatedOn"`
Username string `xml:"username"`
ContainerArt string `xml:"containerArt"`
SourceAccount string `xml:"sourceAccount"`
IsPresetable string `xml:"isPresetable"`
}
// RecentItemParitySource represents the source in a RecentItemParity.
@@ -240,7 +236,7 @@ type RecentItemParitySource struct {
ID string `xml:"id,attr"`
Type string `xml:"type,attr"`
CreatedOn string `xml:"createdOn"`
Credential *RecentItemParityCredential `xml:"credential,omitempty"`
Credential *RecentItemParityCredential `xml:"credential"`
Name string `xml:"name"`
SourceProviderID string `xml:"sourceproviderid"`
SourceName string `xml:"sourcename"`
+9
View File
@@ -120,6 +120,14 @@ func TestServiceRecent_Parity(t *testing.T) {
CreatedOn: "2026-03-22T10:00:04.000+00:00",
UpdatedOn: "2026-03-22T10:53:50.719+00:00",
LastPlayedAt: "2026-03-22T10:53:48.000+00:00",
Source: &RecentItemParitySource{
ID: "10863533",
Type: "Audio",
Credential: &RecentItemParityCredential{
Type: "token",
Value: "",
},
},
}
data, err := xml.MarshalIndent(recent, "", " ")
@@ -137,6 +145,7 @@ func TestServiceRecent_Parity(t *testing.T) {
`<name>Dopamine</name>`,
`<sourceid>10863533</sourceid>`,
`<updatedOn>2026-03-22T10:53:50.719+00:00</updatedOn>`,
`<credential type="token"></credential>`,
}
for _, expected := range expectedElements {