Skip to content

Node SDK: add unit tests for the change password and delete user commands #4796

Closed

Description

@justinmclean

Description

CHANGE_PASSWORD.serialize and DELETE_USER.serialize in the Node SDK have no unit tests. client.socket.test.ts calls them through a mock server but does not check the bytes. CHANGE_PASSWORD writes the user identifier, then each password as a one byte length and the bytes, and throws when either password is under 1 or over 255 bytes (counted in bytes, not characters). DELETE_USER writes only the identifier.

Affected area / component

Node SDK

Proposed solution

Add foreign/node/src/wire/user/change-password.command.test.ts and delete-user.command.test.ts, following create-user.command.test.ts, including its UTF-8 case for the 255 byte limit.

  • Change password: the exact bytes for a numeric user id, an empty current password, an empty new password, a 255 byte password accepted, a 256 byte password refused, and a multi-byte password that is under 255 characters but over 255 bytes.
  • Delete user: the exact bytes for a numeric and a string identifier.
  • Build the expected buffers by hand, so the test does not call the code it checks.

How to test: npm run test:unit and npm run lint pass in foreign/node.

Good first issue

  • I think this could be a good first issue for a new contributor

Activity

  1. added
    good first issue
    test
    javascript
    on Nov 8, 2026
  2. Yasas-Sri commented on Nov 9, 2026

    @Yasas-Sri
    Contributor

    @justinmclean i would like to work on this issue.can you assign me

  3. justinmclean commented on Nov 9, 2026

    @justinmclean
    MemberAuthor

    Thank for offering to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuejavascripttest

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions