feat(phase1): showcase 데모 메타 단일 소스 + 무결성 테스트
- /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>
This commit is contained in:
27
lib/__tests__/showcase-samples.test.ts
Normal file
27
lib/__tests__/showcase-samples.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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]+$/);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user