Skip to content

test(integration): add integration tests for NIP-02 contact lists#552

Merged
cameri merged 5 commits intocameri:mainfrom
vikashsiwach:test/nip02-contact-list-integration
Apr 21, 2026
Merged

test(integration): add integration tests for NIP-02 contact lists#552
cameri merged 5 commits intocameri:mainfrom
vikashsiwach:test/nip02-contact-list-integration

Conversation

@vikashsiwach
Copy link
Copy Markdown
Collaborator

Description

This PR adds integration tests for NIP-02 contact lists (Kind 3), covering replaceable event behavior.

Related Issue

Closes issue #509

Motivation and Context

Currently there were no integration tests for NIP-02 contact list(Kind 3). These tests ensure contact list updates, replacement semantics, and subscription behavior work correctly in practice.

How Has This Been Tested?

  • Integration tests were added under test/integration/features/nip-02/
  • All NIP-02 scenarios pass successfully.
    • Contact list event is stored and retrievable.
    • New Contact list replaces the previous one.
    • Tie-breaker logic for identical timestamps.
    • Subscribers only receive latest contact list event.

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 20, 2026

Coverage Status

coverage: 74.365% (-0.02%) from 74.382% — vikashsiwach:test/nip02-contact-list-integration into cameri:main

@vikashsiwach vikashsiwach requested a review from cameri April 20, 2026 07:21
@cameri cameri requested a review from Copilot April 20, 2026 11:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end Cucumber integration coverage for NIP-02 contact list (kind 3) behavior, ensuring replaceable semantics work correctly through the relay’s WebSocket interface.

Changes:

  • Introduces new NIP-02 feature scenarios covering creation, replacement, identical-timestamp tie-breaker, and subscriber behavior.
  • Adds step definitions to publish kind 3 events with p tags and assert query/subscription results (including EOSE).
  • Includes a Changesets patch entry documenting the test addition.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/integration/features/nip-02/nip-02.feature.ts Adds Cucumber step definitions for publishing and asserting kind 3 contact list behavior, including replacement and tie-breaker cases.
test/integration/features/nip-02/nip-02.feature Adds NIP-02 Gherkin scenarios for contact list storage/replacement/subscription semantics.
.changeset/nip-02-integration-tests.md Records the test addition as a patch changeset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration/features/nip-02/nip-02.feature.ts
Comment thread test/integration/features/nip-02/nip-02.feature.ts
@vikashsiwach
Copy link
Copy Markdown
Collaborator Author

@cameri, I removed the unused state and updated the variable name.

@cameri cameri self-assigned this Apr 21, 2026
@cameri cameri merged commit 25f9637 into cameri:main Apr 21, 2026
11 of 12 checks passed
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.

4 participants