test: analysis / ai / layout / fetch のテスト拡大 (+35)#57
Merged
Conversation
196 → 231 tests (+35) 追加: - tests/uiStates.test.ts 新規 (9) analyzeUIStates: 空 / 小フレーム除外 / ideal 推定 / screen グルーピング / "WF:" prefix 除去 / full coverage / 非 frame ノードスキップ formatReport: en / ja の出力確認 - tests/designDocExport.test.ts 新規 (7) Markdown 出力のヘッダ、locale 別、統計、design tokens 有無、空 doc - tests/aiClients.test.ts 新規 (8) isAIXxxEnabled の URL 有無判定、requestAIReview 正常/失敗/statusText fallback、 requestAIGenerate body 形式 + HTTP status 属性、未設定エラー (vi.stubEnv + vi.resetModules で環境変数を分離) - tests/fetchPen.test.ts 新規 (6) javascript:/data: 禁止、相対パス resolve、https 通過、非 ok → HTTP エラー、 TypeError → CORS ヒント - tests/layout.test.ts (+5) justifyContent: space_between / space_around、padding 2-tuple / 4-tuple、 alignItems: end Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
残っていたテスト薄い領域を網羅。196 → 231 tests (+35)。
tests/uiStates.test.ts新規analyzeUIStates/formatReportの主要パスtests/designDocExport.test.ts新規generateDesignDocの Markdown 構造tests/aiClients.test.ts新規requestAIReview/requestAIGenerateの fetch モックtests/fetchPen.test.ts新規tests/layout.test.ts注意点
aiClients.test.tsはvi.stubEnv('VITE_AI_REVIEW_URL', ...)+vi.resetModulesでテストごとに module を読み直し、import.meta.envの値を分離fetchはvi.stubGlobal('fetch', vi.fn().mockResolvedValue(...))で差し替えTest plan
npm testで 18 ファイル / 231 件全 passnpm run buildOK🤖 Generated with Claude Code