@@ -39,7 +39,7 @@ describe("ManifestActionHandler", () => {
39
39
expect ( manifestFactory ) . toHaveBeenCalledWith ( {
40
40
appBaseUrl : "http://example.com" ,
41
41
request : { } ,
42
- schemaVersion : 3.20 ,
42
+ schemaVersion : 3.2 ,
43
43
} ) ;
44
44
} ) ;
45
45
@@ -64,18 +64,21 @@ describe("ManifestActionHandler", () => {
64
64
expect ( result . status ) . toBe ( 405 ) ;
65
65
expect ( result . body ) . toBe ( "Method not allowed" ) ;
66
66
expect ( manifestFactory ) . not . toHaveBeenCalled ( ) ;
67
- } )
67
+ } ) ;
68
68
69
- it ( "should return 400 when receives null schema version header from unsupported legacy Saleor version" , async ( ) => {
69
+ /**
70
+ * api/manifest endpoint is GET and header should be optional. It can be used to install the app eventually,
71
+ * but also to preview the manifest from the plain GET request
72
+ */
73
+ it ( "should NOT return 400 when receives null schema version header from unsupported legacy Saleor version" , async ( ) => {
70
74
adapter . getHeader = vi . fn ( ) . mockReturnValue ( null ) ;
71
75
const handler = new ManifestActionHandler ( adapter ) ;
72
76
73
77
const manifestFactory = vi . fn ( ) . mockResolvedValue ( mockManifest ) ;
74
78
75
79
const result = await handler . handleAction ( { manifestFactory } ) ;
76
80
77
- expect ( result . status ) . toBe ( 400 ) ;
78
- expect ( result . body ) . toBe ( "Missing schema version header" ) ;
79
- expect ( manifestFactory ) . not . toHaveBeenCalled ( ) ;
81
+ expect ( result . status ) . toBe ( 200 ) ;
82
+ expect ( manifestFactory ) . toHaveBeenCalled ( ) ;
80
83
} ) ;
81
84
} ) ;
0 commit comments