add item by legacy id

This commit is contained in:
JBP
2019-08-15 14:30:19 +02:00
parent 9f314ca925
commit a050a065b3
4 changed files with 185 additions and 8 deletions
+3 -4
View File
@@ -28,11 +28,10 @@ func TestGetItem(t *testing.T) {
defer teardown()
mux.HandleFunc("/buy/browse/v1/item/v1|202117468662|0", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `{"itemId": "v1|202117468662|0", "title": "%s"}`, r.URL.Query().Get("fieldgroups"))
fmt.Fprintf(w, `{"itemId": "%s"}`, r.URL.Query().Get("fieldgroups"))
})
item, err := client.Buy.Browse.GetItem(context.Background(), "v1|202117468662|0", "COMPACT")
item, err := client.Buy.Browse.GetCompactItem(context.Background(), "v1|202117468662|0")
assert.Nil(t, err)
assert.Equal(t, "v1|202117468662|0", item.ItemID)
assert.Equal(t, "COMPACT", item.Title)
assert.Equal(t, "COMPACT", item.ItemID)
}