Skip to content

test: fill branch coverage gaps in appLifecycle + interaction helpers (#107) - #158

Merged
cheerc merged 1 commit into
mainfrom
test/107-p1-lib-branches
Jun 24, 2026
Merged

test: fill branch coverage gaps in appLifecycle + interaction helpers (#107)#158
cheerc merged 1 commit into
mainfrom
test/107-p1-lib-branches

Conversation

@cheerc

@cheerc cheerc commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Add branch gap tests to push tests/lib/ branch coverage closer to 100%.

Gaps Filled

appLifecycleHelpers.js (92.06% → 98.41% branches)

Line Branch Test
L58 Object.keys(schedules)[0] || null — empty schedules resolveScheduleLoad with empty schedules map
L77 data.classrooms || [] — missing classrooms resolveScheduleLoad with partial data
L78 data.scheduleData || {} — missing scheduleData resolveScheduleLoad with partial data
L188 optional chaining fallback resolveDropAction with missing fromClassroom
L197 deep clone splice fallback resolveDropAction cross-classroom move

interactionHelpers.js (93.9% → 100% branches)

Line Branch Test
L30 optional chaining on missing classroom applyDrop with nonexistent fromClassroom
L74-76 null classroom + non-array guard applyNameRename with null/invalid data
L111-113 null classroom + non-array guard applyTeacherRename with null/invalid data

Verification

  • npm test — 1162/1162 pass ✅
  • npx vitest run --coverage — all thresholds pass ✅
  • Only 1 file changed: tests/unit/libBranchGaps.test.js (+105 lines)

refs #107
follows spec

… (refs #107)

Add branch gap tests for:
- appLifecycleHelpers.js: L58 empty-schedules fallback, L77-78 missing
  classrooms/scheduleData defaults, L188/L197 optional chaining in
  resolveDropAction
- interactionHelpers.js: L30 missing fromClassroom, L74-76 null classroom
  in applyNameRename, L111-113 null classroom in applyTeacherRename

Results:
- appLifecycleHelpers.js branches: 92.06% → 98.41%
- interactionHelpers.js branches: 93.9% → 100%
- Overall lib branches: 97.14% → 98.09% → now tracking at 99%+

All 1162 tests pass.

refs #107

Agend-Agent: cb-team-impl2
Agend-Branch: test/107-p1-lib-branches
Agend-Issued-At: 2026-06-24T11:56:23.354995+00:00
@cheerc

cheerc commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

✅ VERIFIED

Reviewed HEAD: ea9590c
Reviewer: cb-team-reviewer
Audit mode: fast_path (D1 — test-only, single file)

Files Reviewed (1)

  • tests/unit/libBranchGaps.test.js (+105) — 8 new branch gap tests

Fast Path Checklist

  • No production code changes
  • 5 appLifecycleHelpers tests: resolveScheduleLoad (3 fallback branches) + resolveDropAction (2 branches)
  • 3 interactionHelpers tests: applyDrop not-found + applyNameRename null guard + applyTeacherRename null guard
  • All tests target specific line refs (L58/77/78/188/197/30/74-76/111-113) ✓
  • refs [Test-Coverage] Phase 2 — 覆蓋缺口補齊 + 重構前置強化 #107

Evidence

  • cited: libBranchGaps.test.js:241-345 — 8 tests for 2 lib helpers

@cheerc
cheerc merged commit d5580a3 into main Jun 24, 2026
1 check passed
@cheerc
cheerc deleted the test/107-p1-lib-branches branch June 24, 2026 12:04
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.

1 participant