@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
33import { fetchContextMillResources , loadManifestFromArchive } from '@/resources/internals'
44
55describe ( 'Context-Mill Manifest Integration' , ( ) => {
6- it ( 'should fetch, unzip, and validate available resources from GitHub releases' , async ( ) => {
6+ it ( 'should fetch, unzip, and validate the manifest from GitHub releases' , async ( ) => {
77 const archive = await fetchContextMillResources ( )
88
99 // Verify archive is not empty
@@ -16,19 +16,19 @@ describe('Context-Mill Manifest Integration', () => {
1616 expect ( validatedManifest . version ) . toBe ( '1.0' )
1717 expect ( Array . isArray ( validatedManifest . resources ) ) . toBe ( true )
1818
19- // The manifest may include resources that are not part of the aggregate archive.
20- const availableResources = validatedManifest . resources . filter ( ( entry ) => ! entry . file || archive [ entry . file ] )
19+ // Verify we have actual resources
20+ expect ( validatedManifest . resources . length ) . toBeGreaterThan ( 0 )
2121
22- // Verify the archive contains actual resources
23- expect ( availableResources . length ) . toBeGreaterThan ( 0 )
24-
25- // Verify each available resource has required fields
26- for ( const entry of availableResources ) {
22+ // Verify each resource has required fields and its file exists in archive
23+ for ( const entry of validatedManifest . resources ) {
2724 expect ( entry . id ) . toBeTruthy ( )
2825 expect ( entry . name ) . toBeTruthy ( )
2926 expect ( entry . resource ) . toBeTruthy ( )
3027 expect ( entry . resource . mimeType ) . toBeTruthy ( )
3128 expect ( entry . resource . text ) . toBeTruthy ( )
29+ if ( entry . file ) {
30+ expect ( archive [ entry . file ] ) . toBeTruthy ( )
31+ }
3232 }
3333 } , 30000 )
3434} )
0 commit comments