@@ -43,15 +43,15 @@ it("executes getPackageChangelog without errors", async () => {
4343 ) . resolves . not . toThrowError ( ) ;
4444} ) ;
4545
46- // TODO: Disabled temporarily until we decide on a testing strategy/policy regarding e2e tests
47- test . skip ( "executes getPackageVersionDependencies without errors" , async ( ) => {
48- await expect (
49- dapper . getPackageVersionDependencies (
50- namespaceId ,
51- packageName ,
52- packageVersion
53- )
54- ) . resolves . not . toThrowError ( ) ;
46+ test ( "executes getPackageVersionDependencies without errors" , async ( ) => {
47+ const response = await dapper . getPackageVersionDependencies (
48+ namespaceId ,
49+ packageName ,
50+ packageVersion
51+ ) ;
52+
53+ expect ( response . count ) . toBeTypeOf ( "number" ) ;
54+ expect ( Array . isArray ( response . results ) ) . toBe ( true ) ;
5555} ) ;
5656
5757it ( "executes getPackageListingDetails without errors" , async ( ) => {
@@ -82,11 +82,27 @@ it("executes getPackageReadme without errors", async () => {
8282 ) . resolves . not . toThrowError ( ) ;
8383} ) ;
8484
85- // TODO: Disabled temporarily until we decide on a testing strategy/policy regarding e2e tests
86- test . skip ( "executes getPackageSource without errors" , async ( ) => {
87- await expect (
88- dapper . getPackageSource ( namespaceId , packageName )
89- ) . resolves . not . toThrowError ( ) ;
85+ test ( "executes getPackageSource when enabled (or 404 when disabled)" , async ( ) => {
86+ try {
87+ const response = await dapper . getPackageSource ( namespaceId , packageName ) ;
88+
89+ // If the endpoint exists in the backend image, validate a minimal shape.
90+ expect ( response ) . toBeTruthy ( ) ;
91+ expect ( response ) . toHaveProperty ( "namespace" ) ;
92+ expect ( response ) . toHaveProperty ( "package_name" ) ;
93+ expect ( response ) . toHaveProperty ( "version_number" ) ;
94+ expect ( response ) . toHaveProperty ( "is_visible" ) ;
95+ expect ( response ) . toHaveProperty ( "decompilations" ) ;
96+ expect ( Array . isArray ( response . decompilations ) ) . toBe ( true ) ;
97+ } catch ( err ) {
98+ // The test backend image used for containerized tests may not include the
99+ // plugin that registers this endpoint. Treat a 404 as "endpoint disabled".
100+ if ( err instanceof Error && err . message . includes ( "404" ) ) {
101+ return ;
102+ }
103+
104+ throw err ;
105+ }
90106} ) ;
91107
92108it ( "executes getPackageVersions without errors" , async ( ) => {
0 commit comments