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>
This commit is contained in:
33
src/app/shared/interactive-lift.spec.ts
Normal file
33
src/app/shared/interactive-lift.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user