test: add unit tests for SocketInstance and ChatE2EE class#452
Open
yashcreator11 wants to merge 4 commits into
Open
test: add unit tests for SocketInstance and ChatE2EE class#452yashcreator11 wants to merge 4 commits into
yashcreator11 wants to merge 4 commits into
Conversation
- Add socket.test.ts covering all event routing, joinChat, dispose, chat-message delivery+ack, and lazy subscription context (muke1908#311) - Add sdk.test.ts covering init, setChannel, encrypt, sendMessage, dispose, guards, and isEncrypted for ChatE2EE class (muke1908#319) - Fix jest.config.js to exclude e2e/ from Jest runs (Playwright conflict) Closes muke1908#311 Closes muke1908#319
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What does this PR do?
Adds unit tests for two open issues:
SocketInstanceinservice/src/socket/socket.tsChatE2EEclass inservice/src/sdk.tsChanges
service/src/socket/socket.test.ts— 15 tests covering constructor,joinChat, dispose, all 6 event listeners, chat-message ack ordering,
and lazy subscription context
service/src/sdk.test.ts— 29 tests covering init, key generation,setChannel, isEncrypted, on, sendMessage, encrypt, getUsersInChannel,
delete, dispose, and method guards before init
jest.config.js— excludee2e/from Jest to fix Playwright conflictTest results
Test Suites: 6 passed, 6 total
Tests: 75 passed, 75 total
All tests pass with no failures.