Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions frontend/scripts/generate-seo-pages.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('emits a canonical crawlable page for every public route', async () => {
const guides = JSON.parse(guideText);
const pages = buildPageDefinitions({ landing: translations.landing, compare: translations.compare, useCases, guides });

assert.equal(pages.length, 27);
assert.equal(pages.length, 28);
assert.deepEqual(pages.map((page) => page.path), [
'/',
'/compare/',
Expand Down Expand Up @@ -48,6 +48,7 @@ test('emits a canonical crawlable page for every public route', async () => {
'/guides/multi-agent-vs-single-agent/',
'/guides/ai-agent-collaboration-patterns/',
'/guides/onboarding-an-ai-agent-to-your-team/',
'/guides/ai-agent-discord-integration/',
]);
assert.deepEqual(pages[0].schema['@graph'].map((item) => item['@type']), [
'Organization',
Expand Down Expand Up @@ -83,7 +84,7 @@ test('emits a canonical crawlable page for every public route', async () => {
'/guides/ai-agent-task-management/',
'/guides/connect-claude-codex-shared-workspace/',
]);
assert.equal(guidePages.length, 17);
assert.equal(guidePages.length, 18);
for (const guide of guidePages) {
assert.equal(guide.ogType, 'article');
const article = guide.schema['@graph'].find((item) => item['@type'] === 'Article');
Expand Down Expand Up @@ -271,6 +272,18 @@ test('emits a canonical crawlable page for every public route', async () => {
assert.match(onboardingHtml, /pending, claimed, blocked, and done/);
assert.match(onboardingHtml, /cm_agent_…/);
assert.doesNotMatch(onboardingHtml, /cm_agent_[A-Za-z0-9]{8,}/);
const discordGuide = guidePages.find((page) => page.path === '/guides/ai-agent-discord-integration/');
assert.equal(discordGuide.title, 'AI Agent Discord Integration: Reviewable Work Signals | Commonly');
const discordHtml = renderStaticPage(guideTemplate, discordGuide);
assert.match(discordHtml, /An AI agent Discord integration connects a Discord conversation/);
assert.match(discordHtml, /Commonly \(commonly\.me\), the shared workspace where humans and AI agents work together/);
assert.match(discordHtml, /\/discord-push/);
assert.match(discordHtml, /every hour/);
assert.match(discordHtml, /@commonly-bot/);
assert.match(discordHtml, /pending, claimed, blocked, and done/);
assert.match(discordHtml, /<pre class="seo-code">[\s\S]*DISCORD_BOT_TOKEN=\.\.\./);
assert.doesNotMatch(discordHtml, /cm_agent_[A-Za-z0-9]{8,}/);
assert.doesNotMatch(discordHtml, /DISCORD_(?:BOT_TOKEN|CLIENT_ID|CLIENT_SECRET)=(?!\.\.\.)[^\s<]+/);
for (const guidePath of [
'/guides/multi-agent-collaboration-platform/',
'/guides/ai-agent-workspace/',
Expand Down Expand Up @@ -360,6 +373,15 @@ test('emits a canonical crawlable page for every public route', async () => {
const html = renderStaticPage(guideTemplate, pages.find((page) => page.path === guidePath));
assert.match(html, /href="\/guides\/onboarding-an-ai-agent-to-your-team\//);
}
for (const guidePath of [
'/guides/ai-agent-events/',
'/guides/onboarding-an-ai-agent-to-your-team/',
'/guides/ai-agent-task-management/',
'/guides/ai-agent-collaboration-patterns/',
]) {
const html = renderStaticPage(guideTemplate, pages.find((page) => page.path === guidePath));
assert.match(html, /href="\/guides\/ai-agent-discord-integration\//);
}
const guidesIndex = pages.find((page) => page.path === '/guides/');
assert.equal(guidesIndex.title, 'Guides for teams working with AI agents | Commonly');
assert.equal(guidesIndex.schema['@graph'].find((item) => item['@type'] === 'WebPage').name, 'Guides for teams working with AI agents');
Expand Down
Loading
Loading