@@ -62,7 +62,51 @@ describe('load config', () => {
6262 test ( 'exc with events config' , async ( ) => {
6363 global . loadFixtureApp ( 'exc-with-events' )
6464 config = await appConfig . load ( { } )
65- expect ( config . all [ 'dx/excshell/1' ] ) . toEqual ( expect . objectContaining ( { events : { registrations : { 'Demo name' : { description : 'Demo description' , events_of_interest : [ { event_codes : [ 'com.adobe.platform.gdpr.joberror' , 'com.adobe.platform.gdpr.producterror' ] , provider_metadata : 'gdpr_events' } , { event_codes : [ 'test-code-skrishna' , 'card_abandonment' ] , provider_metadata : 'aem' } ] , runtime_action : 'my-exc-package/action' } , 'Event Registration Default' : { description : 'Registration for IO Events' , events_of_interest : [ { event_codes : [ 'com.adobe.platform.gdpr.joberror' , 'com.adobe.platform.gdpr.producterror' ] , provider_metadata : 'gdpr_events' } ] , runtime_action : 'my-exc-package/action' } } } } ) )
65+ const eventObj = {
66+ events :
67+ {
68+ registrations :
69+ {
70+ 'Demo name' :
71+ {
72+ description : 'Demo description' ,
73+ events_of_interest :
74+ [
75+ {
76+ event_codes :
77+ [
78+ 'com.adobe.platform.gdpr.joberror' ,
79+ 'com.adobe.platform.gdpr.producterror'
80+ ] ,
81+ provider_metadata : 'gdpr_events'
82+ } ,
83+ {
84+ event_codes : [ 'test-code-skrishna' , 'card_abandonment' ] ,
85+ provider_metadata : 'aem'
86+ }
87+ ] ,
88+ runtime_action : 'my-exc-package/action'
89+ } ,
90+ 'Event Registration Default' :
91+ {
92+ description : 'Registration for IO Events' ,
93+ events_of_interest :
94+ [
95+ {
96+ event_codes :
97+ [
98+ 'com.adobe.platform.gdpr.joberror' ,
99+ 'com.adobe.platform.gdpr.producterror'
100+ ] ,
101+ provider_metadata : 'gdpr_events'
102+ }
103+ ] ,
104+ runtime_action : 'my-exc-package/action'
105+ }
106+ }
107+ }
108+ }
109+ expect ( config . all [ 'dx/excshell/1' ] ) . toEqual ( expect . objectContaining ( eventObj ) )
66110 } )
67111
68112 test ( 'standalone app, exc and nui extension config' , async ( ) => {
@@ -287,6 +331,44 @@ extensions:
287331 expect ( config . implements ) . toEqual ( [ 'application' ] )
288332 } )
289333
334+ test ( 'action config with web-export not in annotations' , async ( ) => {
335+ global . fakeFileSystem . addJson ( {
336+ '/package.json' : '{}' ,
337+ '/app.config.yaml' :
338+ `
339+ application:
340+ runtimeManifest:
341+ packages:
342+ myapp:
343+ actions:
344+ generic:
345+ function: actions/generic/index.js
346+ runtime: nodejs:18
347+ web-export: raw
348+ `
349+ } )
350+ await expect ( appConfig . load ( { } ) ) . rejects . toThrow ( 'Missing or invalid keys in app.config.yaml:' )
351+ } )
352+
353+ test ( 'action config with raw-http not in annotations' , async ( ) => {
354+ global . fakeFileSystem . addJson ( {
355+ '/package.json' : '{}' ,
356+ '/app.config.yaml' :
357+ `
358+ application:
359+ runtimeManifest:
360+ packages:
361+ myapp:
362+ actions:
363+ generic:
364+ function: actions/generic/index.js
365+ runtime: nodejs:18
366+ raw-http: true
367+ `
368+ } )
369+ await expect ( appConfig . load ( { } ) ) . rejects . toThrow ( 'Missing or invalid keys in app.config.yaml:' )
370+ } )
371+
290372 // options
291373 test ( 'standalone app config - ignoreAioConfig=true' , async ( ) => {
292374 global . loadFixtureApp ( 'app' )
0 commit comments