Skip to content
Closed
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
9 changes: 9 additions & 0 deletions web/scripts/__tests__/check-visibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ describe('resolveDeployedPageUrl', () => {
resolveDeployedPageUrl('https://example.org/my-colony/', '/proposals/')
).toBe('https://example.org/my-colony/proposals/');
});

it('resolves feed.xml from root and nested base paths', () => {
expect(resolveDeployedPageUrl('https://example.org', 'feed.xml')).toBe(
'https://example.org/feed.xml'
);
expect(
resolveDeployedPageUrl('https://example.org/my-colony', 'feed.xml')
).toBe('https://example.org/my-colony/feed.xml');
});
});

describe('isValidOpenGraphImageType', () => {
Expand Down
13 changes: 12 additions & 1 deletion web/scripts/check-visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ async function runChecks(): Promise<CheckResult[]> {

const agentsHubUrl = resolveDeployedPageUrl(baseUrl, 'agents/');
const proposalsHubUrl = resolveDeployedPageUrl(baseUrl, 'proposals/');
const [agentsHubRes, proposalsHubRes] = await Promise.all([
const feedXmlUrl = resolveDeployedPageUrl(baseUrl, 'feed.xml');
const [agentsHubRes, proposalsHubRes, feedXmlRes] = await Promise.all([
fetchWithTimeout(agentsHubUrl),
fetchWithTimeout(proposalsHubUrl),
fetchWithTimeout(feedXmlUrl),
]);

const agentsOk = agentsHubRes?.status === 200;
Expand All @@ -414,6 +416,15 @@ async function runChecks(): Promise<CheckResult[]> {
}
);

const feedXmlOk = feedXmlRes?.status === 200;
results.push({
label: 'Deployed feed.xml is reachable',
ok: feedXmlOk,
details: feedXmlOk
? `GET ${feedXmlUrl} returned 200`
: `GET ${feedXmlUrl} returned ${feedXmlRes?.status ?? 'no response'}`,
});

const proposalsHubHtml =
proposalsHubRes?.status === 200 ? await proposalsHubRes.text() : '';
const atomAutodiscoveryPresent = hasAtomAutodiscoveryLink(proposalsHubHtml);
Expand Down
Loading