khatru: add tests for NIP-09 delete hook and edge cases #3

Closed
opened 2026-04-14 14:07:14 +00:00 by priyanshu_bharti · 0 comments

Description

After adding the OnDeleteApplied hook, we need comprehensive tests to ensure the hook behaves correctly in all scenarios and to prevent regressions.

Acceptance Criteria

  • Test successful deletion with e tag (kind 5 deletes target event + hook is called with correct parameters)
  • Test successful deletion with a tag (addressable events)
  • Test "not-author" rejection case (hook should not be called)
  • Test "nothing-to-delete" case (hook should not be called)
  • Test invalid/malformed delete event case (hook should not be called)

All tests should verify that the hook receives the correct deleteEvent and deletedEvent.

References

  • Blocked by / depends on: nostrlib PR for OnDeleteApplied hook
  • Related to: zooid#1 (Deletes don't get broadcasted)
### Description After adding the `OnDeleteApplied` hook, we need comprehensive tests to ensure the hook behaves correctly in all scenarios and to prevent regressions. ### Acceptance Criteria - Test successful deletion with `e` tag (kind 5 deletes target event + hook is called with correct parameters) - Test successful deletion with `a` tag (addressable events) - Test "not-author" rejection case (hook should **not** be called) - Test "nothing-to-delete" case (hook should **not** be called) - Test invalid/malformed delete event case (hook should **not** be called) All tests should verify that the hook receives the correct `deleteEvent` and `deletedEvent`. ### References - Blocked by / depends on: nostrlib PR for `OnDeleteApplied` hook - Related to: zooid#1 (Deletes don't get broadcasted)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/nostrlib#3