[#6] StoryFactory Tests#14
Conversation
Tests cover: - createStoryline: happy path, event emission, empty title revert, invalid CID revert - chainPlot: happy path, correct index emission, wrong writer revert, invalid CID revert, deadline expired revert, no-deadline allows late - donate: happy path with transfer verification, zero amount revert, non-existent storyline revert, insufficient allowance revert Uses MockBond and MockPlot for isolated unit testing. Fixes #6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The test suite is close, but it does not yet satisfy the full issue #6 merge checklist. One of the required chainPlot() revert cases is explicitly called out in the ticket and is still untested.
Findings
- [medium] The
sunsetrevert case is not actually covered.test_chainPlot_revert_sunset()is effectively a placeholder comment and never exercisesrequire(!s.sunset, "Storyline sunset"). Issue #6 explicitly requires coverage for the sunset-story revert path.- File:
test/StoryFactory.t.sol:222 - Suggestion: set the
sunsetflag in storage within the test (for example with Foundry cheatcodes) and assert thatchainPlot()reverts with"Storyline sunset".
- File:
Decision
Request changes because the current test suite does not cover all required chainPlot() revert cases from the ticket, so the merge checklist is not fully met yet.
Use storage slot 2 (not 7) for storylines mapping. vm.store sets sunset=true directly, then verifies chainPlot reverts correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b Review: APPROVE
Sunset revert test confirmed — uses vm.store with correct storage slot calculation to set sunset flag, verifies revert. All 15 tests now functional. Good coverage of happy paths and revert cases across all three functions.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The missing sunset-path coverage is now in place: the test suite uses vm.store to set the packed sunset flag and verifies that chainPlot() reverts with "Storyline sunset". Foundry CI is green on the updated head commit.
Findings
- None.
Decision
Approve because the required revert-case coverage gap is resolved and the PR now satisfies the merge criteria for issue #6.
15 tests: createStoryline (happy, events, reverts), chainPlot (happy, index, reverts), donate (happy, reverts). forge test passes. Fixes #6