Repository navigation
test(identity): add missing tests for id progression, zero runtime key, and unknown tokenURI (fixes #1) - #2
Conversation
…y, and unknown tokenURI (fixes mergit-io#1) Signed-off-by: Arif Rahman <arif.rahman.rhm@gmail.com>
Viscous106
left a comment
There was a problem hiding this comment.
If you need more help or talk regarding the changes feel free to ping me .. Great work otherwise just some changes are needed do that ... Thanks
…y emit, and unknown agent revert
|
All requested review changes have been addressed in commit
All 92/92 tests in the suite pass cleanly and |
There was a problem hiding this comment.
All three of Yash's review points are addressed: the second agentId test now uses a different operator and checks ownerOf on both, there's a sibling test for setRuntimeKey on an unknown agent plus the RuntimeKeyChanged emit assertion, and the transfer test now asserts runtimeKeyOf post-transfer (documenting current behavior: the key isn't cleared on sale). Checked the new assertions against Identity.sol directly error selectors and call order line up. Ready to merge.
|
Thanks for working through the feedback so carefully, Arif the updated tests are solid and the transfer-ownership one is a nice catch to have documented either way. Appreciate it. |
Viscous106
left a comment
There was a problem hiding this comment.
LGTM!! Thanks for this. If you're interested in writing the actual contract fix for the transfer case (#16), let me know there and I'll assign it to you.
Resolves #1
Summary
Adds the three requested unit tests covering core behaviors of
Identity.sol:test_agentIdsIncrease: Verifies registering sequential agents incrementsagentId(1then2).test_setRuntimeKeyRejectsZeroAddress: Verifies setting a runtime key toaddress(0)reverts withZeroRuntimeKey.test_tokenURIOfUnknownAgentReverts: Verifies callingtokenURI(42)on an unminted agent reverts withUnknownAgent(42).Verification & Quality Checks
forge test --match-contract IdentityTestpasses (9/9 tests pass).forge testpasses across full suite (91/91 tests pass).forge fmt --checkis clean with zero formatting errors.test/Identity.t.solmodified.