feat: add route-backed project case studies
Some checks failed
Test and deploy / Verify production build (push) Has been cancelled
Test and deploy / Deploy production (push) Has been cancelled

This commit is contained in:
2026-09-09 22:00:57 +03:30
parent b3cfcfe057
commit 24cd86ede7
25 changed files with 1892 additions and 65 deletions

View File

@@ -61,6 +61,28 @@ test('the standalone server renders both locales and optimizes local images', as
assert.match(persianHtml, /<html[^>]*lang="fa"[^>]*dir="rtl"/i);
assert.match(persianHtml, /سلام، من امیرحسین خلیلی هستم/);
const projectIds = [
'qlockify',
'guilan-ace',
'zarinpal',
'iran-implant',
'interanet-solutions',
'postgresql-job-queue',
'subsource',
];
const projectRoutes = projectIds.flatMap((id) => [`/projects/${id}`, `/fa/projects/${id}`]);
const projectResponses = await Promise.all(projectRoutes.map((route) => fetch(`${origin}${route}`)));
for (const response of projectResponses) assert.equal(response.status, 200);
const projectHtml = await Promise.all(projectResponses.map((response) => response.text()));
for (let index = 0; index < projectHtml.length; index += 1) {
assert.match(projectHtml[index], /<dialog[^>]*aria-labelledby="case-study-title"/i);
assert.match(projectHtml[index], /id="case-study-title"/i);
assert.match(projectHtml[index], /Qlockify|Guilan|زرین|Implant|ایمپلنت|Interanet|اینترانت|PostgreSQL|Subsource|سابسورس/i);
assert.match(projectHtml[index], index % 2 === 0 ? /<html[^>]*dir="ltr"/i : /<html[^>]*dir="rtl"/i);
}
assert.equal((await fetch(`${origin}/projects/not-a-project`)).status, 404);
assert.equal((await fetch(`${origin}/fa/projects/not-a-project`)).status, 404);
const staticAsset = englishHtml.match(/(?:src|href)="(\/_next\/static\/[^"?#]+)/)?.[1];
assert.ok(staticAsset, 'expected a built static asset');
assert.equal((await fetch(`${origin}${staticAsset}`)).status, 200);