Skip to content

feat: add assert event unit test - #657

Merged
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
somotochukwu-dev:add-assert-event-unit-tests-648
Jul 31, 2026
Merged

feat: add assert event unit test#657
Chucks1093 merged 3 commits 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

@somotochukwu-dev
somotochukwu-dev force-pushed the add-assert-event-unit-tests-648 branch from cd5f37f to 894263c Compare July 31, 2026 07:32
@somotochukwu-dev

Copy link
Copy Markdown
Author

@Chucks1093 Good day sir, please merge

@Chucks1093
Chucks1093 merged commit 86d6168 into accesslayerorg:main Jul 31, 2026
1 check passed
@Chucks1093

Copy link
Copy Markdown
Contributor

Okay

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