Files
Portfolio/src/app/shared/interactive-lift.spec.ts
Antonio Ledebuhr a9ad7eb1a7 Rewrite the constraint specs and docs for the service-led information architecture.
Assertions now follow the eighteen prerenderable paths, the gist dialog, and the six-case evidence set.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 00:41:24 +02:00

34 lines
1.4 KiB
TypeScript

import { readFileSync } from 'node:fs';
import { join } from 'node:path';
const ROOT = process.cwd();
function read(path: string): string {
return readFileSync(join(ROOT, path), 'utf8');
}
describe('interactive lift primitive', () => {
it('lives in the global stylesheet, hover-only, and drops transform under reduced motion', () => {
const css = read('src/styles.scss');
expect(css).toContain('.interactive-lift');
expect(css).toMatch(/@media \(hover: hover\) and \(pointer: fine\)/);
expect(css).toMatch(/prefers-reduced-motion:\s*reduce/);
const reduceBlock = css.slice(css.indexOf('prefers-reduced-motion'));
expect(reduceBlock).toMatch(/\.interactive-lift\s*\{[^}]*transform:\s*none/);
expect(reduceBlock).toMatch(/transition:\s*none/);
});
it('is applied to clickable case cards and home service links, not to prose sections', () => {
expect(read('src/app/shared/case-card/case-card.html')).toContain('interactive-lift');
expect(read('src/app/features/home/home.html')).toContain('home-service-card interactive-lift');
expect(read('src/app/shared/content-section/content-section.html')).not.toContain(
'interactive-lift',
);
expect(read('src/app/shared/page-hero/page-hero.html')).not.toContain('interactive-lift');
expect(read('src/app/components/pages/skills/skill-card/skill-card.html')).not.toContain(
'interactive-lift',
);
});
});