Skip to content

test: add tests for WebSocket store#784

Open
d3vobed wants to merge 2 commits into
StellaBridge:mainfrom
d3vobed:test/stores-websocket-store
Open

test: add tests for WebSocket store#784
d3vobed wants to merge 2 commits into
StellaBridge:mainfrom
d3vobed:test/stores-websocket-store

Conversation

@d3vobed

@d3vobed d3vobed commented Jun 28, 2026

Copy link
Copy Markdown

Adds comprehensive tests for the WebSocket store:

  • Initial state verification
  • Connection actions: setStatus, setUrl, markConnected (resets reconnect attempts), markDisconnected, incrementReconnectAttempts, resetReconnectAttempts, setMaxReconnectAttempts
  • Subscription actions: subscribe (pending), confirmSubscription (moves to active), unsubscribe (active and pending), clearPendingSubscriptions, isSubscribed
  • Message actions: addMessage (auto-id, in reverse order), clearMessageHistory, setLastMessage(null)
  • Error actions: addError (reverse order), clearErrors
  • Reset: full state reset to initial values
  • Selectors: selectWebSocketStatus, selectIsConnected, selectActiveChannels, selectLastMessage, selectMessagesByChannel, selectConnectionStats
  • Edge cases: duplicate subscribe on active channel, unsubscribe non-subscribed channel, confirm non-pending subscription, empty message history, empty errors

Follows existing store test conventions from notificationStore.test.ts.

Closes #764

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@d3vobed 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

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 Tests for WebSocket Store

1 participant