test: cover case study gallery and sharing
This commit is contained in:
@@ -36,6 +36,9 @@ test('every project exposes an evidence-based localized case study', async () =>
|
||||
assert.match(source, /export const getProject\s*=/);
|
||||
assert.match(source, /export const getAdjacentProjects\s*=/);
|
||||
assert.match(source, /export const getProjectPath\s*=/);
|
||||
assert.match(source, /screenshots\/qlockify\/qlockify-landing\.png/);
|
||||
assert.match(source, /screenshots\/guilan-ace\/guilan-ace-landing-dark\.png/);
|
||||
assert.match(source, /screenshots\/subsource\/subtitle-detail-light\.png/);
|
||||
});
|
||||
|
||||
test('project cards separate case study navigation from live links', async () => {
|
||||
@@ -54,6 +57,8 @@ test('the case study drawer has accessible and pointer-safe dismissal paths', as
|
||||
const [component, styles] = await Promise.all([
|
||||
Promise.all([
|
||||
'src/components/CaseStudyDrawer.tsx',
|
||||
'src/components/CaseStudyGallery.tsx',
|
||||
'src/components/CaseStudyShare.tsx',
|
||||
'src/components/useDrawerDrag.ts',
|
||||
].map((file) => readFile(file, 'utf8'))).then((files) => files.join('\n')),
|
||||
readFile('src/components/CaseStudyDrawer.module.css', 'utf8'),
|
||||
@@ -63,11 +68,32 @@ test('the case study drawer has accessible and pointer-safe dismissal paths', as
|
||||
assert.match(component, /onCancel=/);
|
||||
assert.match(component, /setPointerCapture/);
|
||||
assert.match(component, /navigator\.clipboard/);
|
||||
assert.match(component, /navigator\.share/);
|
||||
assert.match(component, /aria-live="polite"/);
|
||||
assert.match(component, /data-case-study-initial-focus/);
|
||||
assert.doesNotMatch(component, /data-case-study-heading/);
|
||||
assert.match(component, /unoptimized/);
|
||||
assert.match(component, /quality=\{60\}/);
|
||||
assert.match(component, /aria-haspopup="dialog"/);
|
||||
assert.match(styles, /::backdrop/);
|
||||
assert.match(styles, /env\(safe-area-inset-bottom/);
|
||||
assert.match(styles, /prefers-reduced-motion:\s*reduce/);
|
||||
assert.doesNotMatch(styles, /transition:\s*all/);
|
||||
});
|
||||
|
||||
test('the full-screen gallery and share fallback expose complete interaction paths', async () => {
|
||||
const [gallery, share] = await Promise.all([
|
||||
readFile('src/components/CaseStudyGallery.tsx', 'utf8'),
|
||||
readFile('src/components/CaseStudyShare.tsx', 'utf8'),
|
||||
]);
|
||||
|
||||
assert.match(gallery, /ArrowLeft/);
|
||||
assert.match(gallery, /ArrowRight/);
|
||||
assert.match(gallery, /onPointerDown/);
|
||||
assert.match(gallery, /onPointerUp/);
|
||||
assert.match(gallery, /scrollIntoView/);
|
||||
assert.match(share, /t\.me\/share\/url/);
|
||||
assert.match(share, /wa\.me/);
|
||||
assert.match(share, /linkedin\.com\/sharing\/share-offsite/);
|
||||
assert.match(share, /mailto:/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user