@@ -138,26 +138,20 @@ func TestListJSON(t *testing.T) {
138138 })
139139
140140 // Parse JSON output
141- var catalogs []CatalogWithDigest
141+ var catalogs []CatalogSummary
142142 err = json .Unmarshal ([]byte (output ), & catalogs )
143143 require .NoError (t , err )
144144 assert .Len (t , catalogs , 2 )
145145
146- // Verify first catalog
146+ // Verify first catalog (summary only)
147+ assert .Equal (t , "test/catalog4:latest" , catalogs [0 ].Ref )
147148 assert .Equal (t , "catalog-one" , catalogs [0 ].Title )
148- assert .Equal (t , "source-1" , catalogs [0 ].Source )
149- assert .Len (t , catalogs [0 ].Servers , 1 )
150- assert .Equal (t , workingset .ServerTypeImage , catalogs [0 ].Servers [0 ].Type )
151- assert .Equal (t , "test:v1" , catalogs [0 ].Servers [0 ].Image )
152- assert .Equal (t , []string {"tool1" }, catalogs [0 ].Servers [0 ].Tools )
149+ assert .NotEmpty (t , catalogs [0 ].Digest )
153150
154- // Verify second catalog
151+ // Verify second catalog (summary only)
152+ assert .Equal (t , "test/catalog5:latest" , catalogs [1 ].Ref )
155153 assert .Equal (t , "catalog-two" , catalogs [1 ].Title )
156- assert .Equal (t , "source-2" , catalogs [1 ].Source )
157- assert .Len (t , catalogs [1 ].Servers , 1 )
158- assert .Equal (t , workingset .ServerTypeRegistry , catalogs [1 ].Servers [0 ].Type )
159- assert .Equal (t , "https://example.com" , catalogs [1 ].Servers [0 ].Source )
160- assert .Equal (t , []string {"tool2" , "tool3" }, catalogs [1 ].Servers [0 ].Tools )
154+ assert .NotEmpty (t , catalogs [1 ].Digest )
161155}
162156
163157func TestListJSONEmpty (t * testing.T ) {
@@ -170,7 +164,7 @@ func TestListJSONEmpty(t *testing.T) {
170164 })
171165
172166 // Parse JSON output
173- var catalogs []CatalogWithDigest
167+ var catalogs []CatalogSummary
174168 err := json .Unmarshal ([]byte (output ), & catalogs )
175169 require .NoError (t , err )
176170 assert .Empty (t , catalogs )
@@ -206,18 +200,15 @@ func TestListYAML(t *testing.T) {
206200 })
207201
208202 // Parse YAML output
209- var catalogs []CatalogWithDigest
203+ var catalogs []CatalogSummary
210204 err = yaml .Unmarshal ([]byte (output ), & catalogs )
211205 require .NoError (t , err )
212206 assert .Len (t , catalogs , 1 )
213207
214- // Verify catalog
208+ // Verify catalog (summary only)
209+ assert .Equal (t , "test/catalog6:latest" , catalogs [0 ].Ref )
215210 assert .Equal (t , "catalog-yaml" , catalogs [0 ].Title )
216- assert .Equal (t , "yaml-source" , catalogs [0 ].Source )
217- assert .Len (t , catalogs [0 ].Servers , 1 )
218- assert .Equal (t , workingset .ServerTypeImage , catalogs [0 ].Servers [0 ].Type )
219- assert .Equal (t , "test:yaml" , catalogs [0 ].Servers [0 ].Image )
220- assert .Equal (t , []string {"tool1" , "tool2" }, catalogs [0 ].Servers [0 ].Tools )
211+ assert .NotEmpty (t , catalogs [0 ].Digest )
221212}
222213
223214func TestListYAMLEmpty (t * testing.T ) {
@@ -230,7 +221,7 @@ func TestListYAMLEmpty(t *testing.T) {
230221 })
231222
232223 // Parse YAML output
233- var catalogs []CatalogWithDigest
224+ var catalogs []CatalogSummary
234225 err := yaml .Unmarshal ([]byte (output ), & catalogs )
235226 require .NoError (t , err )
236227 assert .Empty (t , catalogs )
@@ -271,15 +262,15 @@ func TestListWithSnapshot(t *testing.T) {
271262 require .NoError (t , err )
272263 })
273264
274- var result []CatalogWithDigest
265+ var result []CatalogSummary
275266 err = json .Unmarshal ([]byte (output ), & result )
276267 require .NoError (t , err )
277268 assert .Len (t , result , 1 )
278269
279- // Verify snapshot is included
280- require . NotNil (t , result [0 ].Servers [ 0 ]. Snapshot )
281- assert .Equal (t , "test-server " , result [0 ].Servers [ 0 ]. Snapshot . Server . Name )
282- assert .Equal (t , "Test description" , result [0 ].Servers [ 0 ]. Snapshot . Server . Description )
270+ // Verify only summary fields are present
271+ assert . Equal (t , "test/catalog7:latest" , result [0 ].Ref )
272+ assert .Equal (t , "snapshot-catalog " , result [0 ].Title )
273+ assert .NotEmpty (t , result [0 ].Digest )
283274}
284275
285276func TestListWithMultipleServers (t * testing.T ) {
@@ -319,19 +310,15 @@ func TestListWithMultipleServers(t *testing.T) {
319310 require .NoError (t , err )
320311 })
321312
322- var result []CatalogWithDigest
313+ var result []CatalogSummary
323314 err = json .Unmarshal ([]byte (output ), & result )
324315 require .NoError (t , err )
325316 assert .Len (t , result , 1 )
326- assert .Len (t , result [0 ].Servers , 3 )
327317
328- // Just verify that all three server types are present, order may vary
329- types := make (map [workingset.ServerType ]int )
330- for _ , s := range result [0 ].Servers {
331- types [s .Type ]++
332- }
333- assert .Equal (t , 2 , types [workingset .ServerTypeImage ])
334- assert .Equal (t , 1 , types [workingset .ServerTypeRegistry ])
318+ // Verify only summary fields are present
319+ assert .Equal (t , "test/catalog8:latest" , result [0 ].Ref )
320+ assert .Equal (t , "multi-server-catalog" , result [0 ].Title )
321+ assert .NotEmpty (t , result [0 ].Digest )
335322}
336323
337324func TestListHumanReadableEmptyDoesNotShowInJSON (t * testing.T ) {
@@ -344,7 +331,7 @@ func TestListHumanReadableEmptyDoesNotShowInJSON(t *testing.T) {
344331 require .NoError (t , err )
345332 })
346333
347- var catalogs []CatalogWithDigest
334+ var catalogs []CatalogSummary
348335 err := json .Unmarshal ([]byte (outputJSON ), & catalogs )
349336 require .NoError (t , err )
350337 assert .Empty (t , catalogs )
0 commit comments