Skip to content

Commit 6dd366a

Browse files
review comments addressed
1 parent 8539d7b commit 6dd366a

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

src/tasks/demo-url-processor/handler.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ function getImsTenantId(imsOrgId, organization, context, log) {
3535
} catch (error) {
3636
log.error('Error loading IMS_ORG_TENANT_ID_MAPPINGS mapping:', error.message);
3737
}
38-
3938
if (!name) {
40-
log.error('Organization name is missing, using fallback tenant ID');
41-
return 'unknown-tenant';
39+
log.error('Organization name is missing, using default tenant ID');
40+
return context.env.DEFAULT_TENANT_ID;
41+
} else {
42+
return name.toLowerCase().replace(/\s+/g, '');
4243
}
43-
44-
return name.toLowerCase().replace(/\s+/g, '');
4544
}
4645

4746
/**

src/tasks/opportunity-status-processor/handler.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ function getOpportunityTitle(opportunityType) {
2424
const opportunityTitles = {
2525
cwv: 'Core Web Vitals',
2626
'meta-tags': 'SEO Meta Tags',
27-
'broken-back-links': 'Broken Back Links',
28-
'broken-links': 'Broken Links',
27+
'broken-backlinks': 'Broken Backlinks',
28+
'broken-internal-links': 'Broken Internal Links',
29+
'alt-text': 'Alt Text',
30+
sitemap: 'Sitemap',
2931
};
3032

3133
// Check if the opportunity type exists in our map

test/tasks/demo-url-processor/demo-url-processor.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,14 @@ describe('Demo URL Processor', () => {
160160
// name property is missing
161161
});
162162

163+
// Set default tenant ID
164+
context.env.DEFAULT_TENANT_ID = 'default-tenant';
165+
163166
await runDemoUrlProcessor(message, context);
164167

165168
// Should log error about missing name and use fallback
166-
expect(context.log.error.calledWith('Organization name is missing, using fallback tenant ID')).to.be.true;
167-
const expectedDemoUrl = 'https://example.com?organizationId=test-org-id#/@unknown-tenant/sites-optimizer/sites/test-site-id/home';
169+
expect(context.log.error.calledWith('Organization name is missing, using default tenant ID')).to.be.true;
170+
const expectedDemoUrl = 'https://example.com?organizationId=test-org-id#/@default-tenant/sites-optimizer/sites/test-site-id/home';
168171
expect(context.log.info.calledWith(`Setup complete! Access your demo environment here: ${expectedDemoUrl}`)).to.be.true;
169172
});
170173
});

0 commit comments

Comments
 (0)