@@ -300,10 +300,10 @@ describe('Opportunity Status Processor', () => {
300300 expect ( mockSite . getOpportunities . called ) . to . be . true ;
301301 } ) ;
302302
303- it ( 'should check AHREFS Import data availability' , async ( ) => {
304- // Set audit type that requires AHREFSImport
303+ it ( 'should check SEO Import data availability' , async ( ) => {
304+ // Set audit type that requires SEOImport
305305 message . taskContext . auditTypes = [ 'meta-tags' ] ;
306- // Mock AHREFSImport data available
306+ // Mock SEOImport data available
307307 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . resolves ( [
308308 { url : 'https://example.com/page1' , traffic : 100 } ,
309309 { url : 'https://example.com/page2' , traffic : 50 } ,
@@ -319,14 +319,14 @@ describe('Opportunity Status Processor', () => {
319319
320320 await runOpportunityStatusProcessor ( message , context ) ;
321321
322- expect ( context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . calledWith ( 'test-site-id' , 'ahrefs ' , 'global' ) ) . to . be . true ;
323- expect ( context . log . info . calledWith ( 'AHREFS Import data availability for site test-site-id: Available (2 top pages)' ) ) . to . be . true ;
322+ expect ( context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . calledWith ( 'test-site-id' , 'seo ' , 'global' ) ) . to . be . true ;
323+ expect ( context . log . info . calledWith ( 'SEO Import data availability for site test-site-id: Available (2 top pages)' ) ) . to . be . true ;
324324 } ) ;
325325
326- it ( 'should handle AHREFSImport data not available' , async ( ) => {
327- // Set audit type that requires AHREFSImport
326+ it ( 'should handle SEOImport data not available' , async ( ) => {
327+ // Set audit type that requires SEOImport
328328 message . taskContext . auditTypes = [ 'meta-tags' ] ;
329- // Mock AHREFSImport data not available
329+ // Mock SEOImport data not available
330330 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . resolves ( [ ] ) ;
331331
332332 const mockOpportunities = [
@@ -339,13 +339,13 @@ describe('Opportunity Status Processor', () => {
339339
340340 await runOpportunityStatusProcessor ( message , context ) ;
341341
342- expect ( context . log . info . calledWith ( 'AHREFS Import data availability for site test-site-id: Not available (0 top pages)' ) ) . to . be . true ;
342+ expect ( context . log . info . calledWith ( 'SEO Import data availability for site test-site-id: Not available (0 top pages)' ) ) . to . be . true ;
343343 } ) ;
344344
345- it ( 'should handle AHREFSImport check errors' , async ( ) => {
346- // Set audit type that requires AHREFSImport
345+ it ( 'should handle SEOImport check errors' , async ( ) => {
346+ // Set audit type that requires SEOImport
347347 message . taskContext . auditTypes = [ 'meta-tags' ] ;
348- // Mock AHREFSImport check error
348+ // Mock SEOImport check error
349349 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . rejects ( new Error ( 'Database error' ) ) ;
350350
351351 const mockOpportunities = [
@@ -358,7 +358,7 @@ describe('Opportunity Status Processor', () => {
358358
359359 await runOpportunityStatusProcessor ( message , context ) ;
360360
361- expect ( context . log . error . calledWith ( 'Error checking AHREFS Import data availability for site test-site-id: Database error' ) ) . to . be . true ;
361+ expect ( context . log . error . calledWith ( 'Error checking SEO Import data availability for site test-site-id: Database error' ) ) . to . be . true ;
362362 } ) ;
363363 } ) ;
364364
@@ -817,12 +817,12 @@ describe('Opportunity Status Processor', () => {
817817 expect ( context . log . info . calledWithMatch ( 'Processing opportunities' ) ) . to . be . true ;
818818 } ) ;
819819
820- it ( 'should detect AHREFSImport failure from runbook' , async ( ) => {
820+ it ( 'should detect SEOImport failure from runbook' , async ( ) => {
821821 const mockOpportunities = [
822822 {
823823 getType : ( ) => 'seo' ,
824824 getSuggestions : sinon . stub ( ) . resolves ( [ ] ) ,
825- getData : ( ) => ( { runbook : 'AHREFSImport data is required for this analysis' } ) ,
825+ getData : ( ) => ( { runbook : 'SEOImport data is required for this analysis' } ) ,
826826 } ,
827827 ] ;
828828 mockSite . getOpportunities . resolves ( mockOpportunities ) ;
@@ -1045,35 +1045,35 @@ describe('Opportunity Status Processor', () => {
10451045 } ) ;
10461046 } ) ;
10471047
1048- describe ( 'Import and AHREFSImport Checks' , ( ) => {
1049- it ( 'should handle AHREFSImport check errors gracefully' , async ( ) => {
1050- // Set audit type that requires AHREFSImport
1048+ describe ( 'Import and SEOImport Checks' , ( ) => {
1049+ it ( 'should handle SEOImport check errors gracefully' , async ( ) => {
1050+ // Set audit type that requires SEOImport
10511051 message . taskContext . auditTypes = [ 'meta-tags' ] ;
10521052 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo . rejects ( new Error ( 'Database error' ) ) ;
10531053
10541054 await runOpportunityStatusProcessor ( message , context ) ;
10551055
1056- expect ( context . log . error . calledWithMatch ( 'Error checking AHREFS Import data availability' ) ) . to . be . true ;
1056+ expect ( context . log . error . calledWithMatch ( 'Error checking SEO Import data availability' ) ) . to . be . true ;
10571057 } ) ;
10581058
1059- it ( 'should check AHREFSImport data with specific source and geo parameters' , async ( ) => {
1060- // Set audit type that requires AHREFSImport
1059+ it ( 'should check SEOImport data with specific source and geo parameters' , async ( ) => {
1060+ // Set audit type that requires SEOImport
10611061 message . taskContext . auditTypes = [ 'meta-tags' ] ;
10621062 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
1063- . withArgs ( 'test-site-id' , 'ahrefs ' , 'global' )
1063+ . withArgs ( 'test-site-id' , 'seo ' , 'global' )
10641064 . resolves ( [ { url : 'https://example.com/page1' } ] ) ;
10651065
10661066 await runOpportunityStatusProcessor ( message , context ) ;
10671067
10681068 expect ( context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
1069- . calledWith ( 'test-site-id' , 'ahrefs ' , 'global' ) ) . to . be . true ;
1069+ . calledWith ( 'test-site-id' , 'seo ' , 'global' ) ) . to . be . true ;
10701070 } ) ;
10711071
1072- it ( 'should log AHREFS Import data availability with page count' , async ( ) => {
1073- // Set audit type that requires AHREFSImport
1072+ it ( 'should log SEO Import data availability with page count' , async ( ) => {
1073+ // Set audit type that requires SEOImport
10741074 message . taskContext . auditTypes = [ 'meta-tags' ] ;
10751075 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
1076- . withArgs ( 'test-site-id' , 'ahrefs ' , 'global' )
1076+ . withArgs ( 'test-site-id' , 'seo ' , 'global' )
10771077 . resolves ( [
10781078 { url : 'https://example.com/page1' } ,
10791079 { url : 'https://example.com/page2' } ,
@@ -1082,7 +1082,7 @@ describe('Opportunity Status Processor', () => {
10821082
10831083 await runOpportunityStatusProcessor ( message , context ) ;
10841084
1085- expect ( context . log . info . calledWithMatch ( 'AHREFS Import data availability' ) ) . to . be . true ;
1085+ expect ( context . log . info . calledWithMatch ( 'SEO Import data availability' ) ) . to . be . true ;
10861086 expect ( context . log . info . calledWithMatch ( '3 top pages' ) ) . to . be . true ;
10871087 } ) ;
10881088 } ) ;
@@ -1560,9 +1560,9 @@ describe('Opportunity Status Processor', () => {
15601560 } ;
15611561 message . taskContext . auditTypes = [ 'cwv' , 'broken-backlinks' ] ;
15621562
1563- // Mock AHREFSImport and Import available
1563+ // Mock SEOImport and Import available
15641564 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
1565- . withArgs ( message . siteId , 'ahrefs ' , 'global' )
1565+ . withArgs ( message . siteId , 'seo ' , 'global' )
15661566 . resolves ( [ { url : 'https://example.com/page1' } ] ) ;
15671567
15681568 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
@@ -1578,7 +1578,7 @@ describe('Opportunity Status Processor', () => {
15781578 {
15791579 getType : ( ) => 'broken-backlinks' ,
15801580 getSuggestions : sinon . stub ( ) . resolves ( [ ] ) ,
1581- getData : ( ) => ( { runbook : 'AHREFSImport data required' } ) ,
1581+ getData : ( ) => ( { runbook : 'SEOImport data required' } ) ,
15821582 } ,
15831583 ] ;
15841584 mockSite . getOpportunities . resolves ( mockOpportunities ) ;
@@ -1893,13 +1893,13 @@ describe('Opportunity Status Processor', () => {
18931893 threadTs : 'test-thread' ,
18941894 } ;
18951895
1896- // Mock import and AHREFSImport as available
1896+ // Mock import and SEOImport as available
18971897 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo = sinon . stub ( ) ;
18981898 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
18991899 . withArgs ( message . siteId )
19001900 . resolves ( [ { url : 'https://example.com/page1' } ] ) ;
19011901 context . dataAccess . SiteTopPage . allBySiteIdAndSourceAndGeo
1902- . withArgs ( message . siteId , 'ahrefs ' , 'global' )
1902+ . withArgs ( message . siteId , 'seo ' , 'global' )
19031903 . resolves ( [ { url : 'https://example.com/page1' , traffic : 1000 } ] ) ;
19041904
19051905 const mockOpportunities = [
@@ -1912,7 +1912,7 @@ describe('Opportunity Status Processor', () => {
19121912
19131913 await runOpportunityStatusProcessor ( message , context ) ;
19141914
1915- // When no siteUrl, RUM/GSC/Scraping are false, but AHREFSImport and Import are true
1915+ // When no siteUrl, RUM/GSC/Scraping are false, but SEOImport and Import are true
19161916 // This will trigger "Services requiring log analysis" log,
19171917 // not "All service preconditions passed"
19181918 // The test verifies the function executes without errors
0 commit comments