Skip to content

一括削除テストの UUID 抽出を実コードの直接 import に切り替える - #78

Merged
champierre merged 1 commit into
mainfrom
fix/admin-calendar-special-shift-delete
Oct 8, 2026
Merged

champierre merged 1 commit into
mainfrom
fix/admin-calendar-special-shift-delete

Conversation

@champierre

Copy link
Copy Markdown
Contributor

概要

PR #77 の補足に書いた、test/bulk-delete.test.js に残っていた旧い UUID 取り出し処理のインラインコピーを解消します。テストコードだけの変更で、アプリの挙動は変わりません。

変更内容

  • カレンダー用(extractCalendarUuids)と全シフト一覧用(extractAllShiftsUuids)のインラインコピーを削除しました。
  • 代わりに js/modules/shifts.js の collectUuidsByType() を直接 import して検証します(docs/refactoring/phase-1-test-foundation.md の方針)。
  • 全シフト一覧で、特別シフト申請の行が specialUuids に振り分けられることのテストを追加しました。

残っているもの

同じファイルの「削除フロー」のコピー(runBulkDeleteFlow)は変更していません。実コードは deleteShiftsByType() を呼ぶようになりましたが、コピーは deleteMultipleShifts のモックを呼んだままです。実コード側が無名のイベントハンドラで import できないため、ハンドラの切り出しが必要です。

テスト

  • npm test: 430 passed(33 suites)

🤖 Generated with Claude Code

test/bulk-delete.test.js の UUID 抽出テストは、カレンダー用と全シフト一覧用の
取り出し処理をテスト内にコピーして検証していた。実コードは
collectUuidsByType() に統一され、全シフト一覧の属性も data-shift-uuid から
data-uuids に変わったため、コピーは存在しないコードを検証していた。

コピーを削除し、js/modules/shifts.js の collectUuidsByType() を直接 import
して検証するようにした。全シフト一覧で特別シフト申請の行が specialUuids に
振り分けられることのテストも追加した。

同じファイルの「削除フロー」のコピー(runBulkDeleteFlow)は、実コードが
無名のイベントハンドラのため import できず、今回は変更していない。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@champierre
champierre merged commit 48b1cb0 into main Oct 8, 2026
2 checks passed
@champierre
champierre deleted the fix/admin-calendar-special-shift-delete branch October 8, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants