- /showcase 제작 사례 허브가 소비할 데모 8종 메타 모듈화 - slug/title/description/tags 필수 필드 검증 테스트 3건 - Task 2(showcase 라우트)가 SHOWCASE_SAMPLES import 가능 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
932 B
TypeScript
28 lines
932 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { SHOWCASE_SAMPLES } from '../showcase-samples';
|
|
|
|
const EXPECTED_SLUGS = [
|
|
'bakery', 'corporate', 'dashboard', 'game',
|
|
'interior', 'portfolio', 'reading', 'shopping',
|
|
];
|
|
|
|
describe('SHOWCASE_SAMPLES', () => {
|
|
it('데모 8종의 slug가 정확히 존재한다', () => {
|
|
expect(SHOWCASE_SAMPLES.map((s) => s.slug).sort()).toEqual([...EXPECTED_SLUGS].sort());
|
|
});
|
|
|
|
it('모든 항목에 title/description/tags가 채워져 있다', () => {
|
|
for (const s of SHOWCASE_SAMPLES) {
|
|
expect(s.title.length).toBeGreaterThan(0);
|
|
expect(s.description.length).toBeGreaterThan(0);
|
|
expect(s.tags.length).toBeGreaterThan(0);
|
|
}
|
|
});
|
|
|
|
it('demo 경로는 /work/website/samples/[slug] 형식이다', () => {
|
|
for (const s of SHOWCASE_SAMPLES) {
|
|
expect(`/work/website/samples/${s.slug}`).toMatch(/^\/work\/website\/samples\/[a-z]+$/);
|
|
}
|
|
});
|
|
});
|