Skip to content

feat: add assert event unit test - #657

Open
somotochukwu-dev wants to merge 1 commit into
accesslayerorg:mainfrom
somotochukwu-dev:add-assert-event-unit-tests-648
Open

feat: add assert event unit test#657
somotochukwu-dev wants to merge 1 commit into
accesslayerorg:mainfrom
somotochukwu-dev:add-assert-event-unit-tests-648

Conversation

@somotochukwu-dev

Copy link
Copy Markdown

Add unit tests for assert_event_topic_matches helper

Changes

creator-keys/tests/events.rs

  • Updated assert_event_topic_matches panic message to include expected and actual topic values: "event topic mismatch: expected {:?}, got {:?}" so topic mismatches are immediately diagnosable.
  • Updated existing test_assert_event_topic_matches_rejects_unexpected_identifier to match the new panic message format.
  • Added 4 new unit tests:
    • test_assert_event_topic_matches_panics_on_buy_vs_sell_mismatch — emits a buy event and calls helper with sell topic, asserts panic.
    • test_assert_event_topic_matches_passes_on_matching_topic — emits a buy event and calls helper with buy topic, asserts no panic.
    • test_assert_event_topic_matches_panics_when_no_topics — passes an event with empty topics, asserts panic with "event topic should be present".
    • test_assert_event_topic_mismatch_message_identifies_topics — uses catch_unwind to verify the panic message contains both expected and actual topic names.

Closes #648

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@somotochukwu-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093

Copy link
Copy Markdown
Contributor

Fix the CI

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.

Add unit tests for the assert_event helper correctly failing when event topic does not match

3 participants