Skip to content

fix: Update unit tests to match revised IP capture behavior [CHI-3828]#4279

Closed
Copilot wants to merge 2 commits intogian_CHI-3828from
copilot/sub-pr-4271
Closed

fix: Update unit tests to match revised IP capture behavior [CHI-3828]#4279
Copilot wants to merge 2 commits intogian_CHI-3828from
copilot/sub-pr-4271

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Description

Fixes unit tests broken by the CHI-3828 changes that moved IP lookup responsibility into getUserIp itself. Previously the call site guarded against a missing ipLookupServiceApiKey before calling getUserIp; now getUserIp accepts an optional key and returns '0.0.0.0' internally when it's absent.

genericActions.test.ts

  • Updated "should not fetch ip when captureIp is true but ipLookupServiceApiKey is not set"getUserIp is now always called when captureIp: true, passing undefined when no key is configured. Test now asserts it's called with undefined and that the fallback IP appears in formData.

ipTracker.test.ts

  • Added test case: getUserIp(undefined) returns '0.0.0.0' without invoking fetch.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

Run the webchat test suite:

cd aselo-webchat-react-app && npm test -- --no-coverage

All 406 tests pass across 48 suites.

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

Copilot AI changed the title [WIP] Chore: Revise trigger message to include IP address fix: Update unit tests to match revised IP capture behavior [CHI-3828] Apr 30, 2026
Copilot AI requested a review from gpaoloni April 30, 2026 17:30
@gpaoloni gpaoloni closed this Apr 30, 2026
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