Skip to content

test: Add unit tests for MessagingCanvasPhase auto-message and session reducer actions [CHI-3828]#4282

Merged
gpaoloni merged 2 commits intogian_CHI-3828from
copilot/sub-pr-4271-again
Apr 30, 2026
Merged

test: Add unit tests for MessagingCanvasPhase auto-message and session reducer actions [CHI-3828]#4282
gpaoloni merged 2 commits intogian_CHI-3828from
copilot/sub-pr-4271-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Description

Adds missing unit tests for the changes introduced in the parent PR (trigger message IP/contact identifier inclusion).

MessagingCanvasPhase — auto first message construction:

  • contactIdentifier takes priority when present
  • ipAddress used when contactIdentifier absent
  • contactIdentifier preferred over ipAddress when both present
  • Falls back to DEFAULT_CUSTOMER_DEFAULT_NAME ('Anonymous') when no identifier or localization available — tested via jest.spyOn on localizeKey (which otherwise returns the key name itself as fallback, making the hardcoded default unreachable without mocking)

session.reducer — new actions:

  • ACTION_SET_IP_ADDRESS sets ipAddress in state
  • ACTION_SET_CONTACT_IDENTIFIER sets contactIdentifier in state

Checklist

Other Related Issues

Parent PR: #4271

Verification steps

Run npm run test in aselo-webchat-react-app/ — all 411 tests pass.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

…n reducer new actions [CHI-3828]

Agent-Logs-Url: https://github.com/techmatters/flex-plugins/sessions/c23b823e-464f-47a2-97d4-4b403e917f97

Co-authored-by: gpaoloni <15805319+gpaoloni@users.noreply.github.com>
Copilot AI changed the title [WIP] Revise trigger message to include IP address test: Add unit tests for MessagingCanvasPhase auto-message and session reducer actions [CHI-3828] Apr 30, 2026
Copilot AI requested a review from gpaoloni April 30, 2026 20:44
@gpaoloni gpaoloni marked this pull request as ready for review April 30, 2026 20:57
@gpaoloni gpaoloni merged commit 3957964 into gian_CHI-3828 Apr 30, 2026
25 checks passed
@gpaoloni gpaoloni deleted the copilot/sub-pr-4271-again branch April 30, 2026 20:57
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.

2 participants