@@ -142,6 +142,34 @@ describe('GetLlmoConfigSummaryCommand', () => {
142142 expect ( context . log . info . calledWith ( sinon . match ( 'LLMO config summary completed: 1 sites processed' ) ) ) . to . be . true ;
143143 } ) ;
144144
145+ it ( 'successfully generates CSV for missing IMS org name' , async ( ) => {
146+ const mockSites = [ {
147+ getId : ( ) => 'site-1' ,
148+ getBaseURL : ( ) => 'https://test.com' ,
149+ getOrganizationId : ( ) => 'org-1' ,
150+ getConfig : ( ) => ( { getLlmoConfig : ( ) => ( { llmo : true } ) } ) ,
151+ } ] ;
152+
153+ const mockConfig = {
154+ categories : { cat1 : { } } ,
155+ topics : { topic1 : { prompts : [ 'prompt1' ] } } ,
156+ brands : { aliases : [ 'alias1' ] } ,
157+ competitors : { competitors : [ 'comp1' ] } ,
158+ deleted : { prompts : { deleted1 : { } } } ,
159+ cdnBucketConfig : { cdnProvider : 'cloudflare' } ,
160+ } ;
161+
162+ context . dataAccess . Site . all . resolves ( mockSites ) ;
163+ context . dataAccess . Organization . findById . resolves ( { getImsOrgId : ( ) => 'valid@AdobeOrg' , getName : ( ) => undefined } ) ;
164+ readConfigStub . resolves ( { config : mockConfig , exists : true } ) ;
165+
166+ const command = GetLlmoConfigSummaryCommand ( context ) ;
167+ await command . handleExecution ( [ ] , slackContext ) ;
168+
169+ expect ( sendFileStub . called ) . to . be . true ;
170+ expect ( context . log . info . calledWith ( sinon . match ( 'LLMO config summary completed: 1 sites processed' ) ) ) . to . be . true ;
171+ } ) ;
172+
145173 it ( 'handles errors gracefully' , async ( ) => {
146174 context . dataAccess . Site . all . rejects ( new Error ( 'Database error' ) ) ;
147175 const command = GetLlmoConfigSummaryCommand ( context ) ;
0 commit comments