test: createScanAction の beforeScan ordering test 名と assertion を整合 (#236)#245
Merged
Merged
Conversation
) - `src/stores/createScanAction.test.ts:134` の test 名が「ordering を主張」しているが、assertion は最終状態 (currentKey / items / loading) のみ確認しており、ordering 自体を assert していない。test 名と実装の乖離を解消するため、issue #236 Option A (test 名を最終状態 assertion 向きに rename) を採用 - "beforeScan: pre-state mutations are applied before loading flips" → "beforeScan: pre-state mutations are reflected in the final state" - Diff: +1 / -1 (test 名のみ、production code 無変更) - `pnpm test src/stores/createScanAction.test.ts` 8 ケース全 pass、全体 vitest 2230 pass、typecheck / biome clean
This was referenced Jun 27, 2026
ymnao
added a commit
that referenced
this pull request
Jun 27, 2026
* fix: electron e2e の launch fixture teardown timeout を 60s に拡大する PR #245 の初回 CI で flaky fail した `structured-error.electron.spec.ts` の `Tearing down "launch" exceeded the test timeout of 30000ms.` を救済する。 `launch` fixture は明示的な timeout を持たなかったため test timeout (default 30s) と共有していた。`{ timeout: 60_000 }` を Playwright の 配列形式で明示し、teardown 単独に 60s の余裕を持たせる (test 本体の timeout は default 30s のまま据え置きで、本体 hang の検出は従来通り維持)。 Closes #246 * refactor: launch fixture の cleanup コメント圧縮と teardown 並列化 /simplify レビューを適用: - 5 行コメントを 2 行に圧縮 (Playwright 仕様解説は公式 doc 任せ) - teardown の sequential `for...of + await app.close()` を `Promise.all` 化。再 launch test で teardown が直列で線形に 伸びるのを抑制し、今回の timeout 拡張動機 (teardown 余裕確保) と整合
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.
概要
src/stores/createScanAction.test.ts:134の test 名が「ordering を主張」("are applied before loading flips") しているが、assertion は最終状態 (currentKey/items/loading) のみ確認しており、ordering 自体を assert していない。test 名と実装の乖離を解消するため、test 名を最終状態 assertion 向きに rename した。関連 Issue
closes #236
移行 Stage
該当なし (v0.7.0 milestone の quick win batch、test 整備)。
変更内容
src/stores/createScanAction.test.ts:134の test 名を rename"beforeScan: pre-state mutations are applied before loading flips""beforeScan: pre-state mutations are reflected in the final state"採用方針 (Option A)
Issue #236 で提示された 2 案のうち Option A (test 名 rename) を採用。
callOrderspy + set wrapper で ordering 確認に強化。spy 機構の追加で scope やや大きく、また現状の assertion (currentKey/items/loadingが beforeScan 適用後の値で観測される) が間接的に「beforeScan の mutation が最終 state に reflect される」契約を保証しているため、ordering 自体の厳密な assert は必要性が低いと判断動作確認
pnpm test src/stores/createScanAction.test.ts— 8 ケース全 passtsc --noEmitcleanbiome check src/stores/createScanAction.test.tscleanスクリーンショット
該当なし (test 名 rename のみ、UI 変更なし)。