Skip to content

test(intercom): make no-version identify tests omit apiVersion and drop duplicate - #5749

Merged
krishna2020 merged 1 commit into
developfrom
test/intercom-processor-test-fixes
Nov 3, 2026
Merged

krishna2020 merged 1 commit into
developfrom
test/intercom-processor-test-fixes

Conversation

@krishna2020

Copy link
Copy Markdown
Collaborator

What are the changes introduced in this PR?

Fixes two problems in the Intercom processor component tests. Tests only — no production code changes.

1. "No Version" identify tests didn't test a missing apiVersion (intercom-identify-test-11, -12, -13)

  • They built the destination as { ...v1Destination, apiVersion: undefined }, which sets apiVersion on the destination object, not in Config. Config.apiVersion stayed 'v1', so they exercised v1 (/users, Intercom-Version: 1.4).
  • Their success criteria also said the destination defaults to v1, but the transform defaults to v2 when Config.apiVersion is not set (procWorkflow.yaml, apiVersion step).
  • They now use a Config without apiVersion and expect the v2 output the transform produces:
Test Expected now
intercom-identify-test-11 search finds no contact → POST /contacts with external_id (from context.traits.userId)
intercom-identify-test-12 search finds no contact → POST /contacts
intercom-identify-test-13 search finds a contact → PUT /contacts/<id>
  • Test 13's traits now use a distinct email ([email protected]). Tests 12 and 13 previously had identical traits, so they sent the same search and could not take different paths; with a distinct email, 13 covers the update path its description names.
  • Added the three POST /contacts/search mocks these cases need (network.ts).
  • Descriptions and success criteria now say the destination defaults to v2.

2. Duplicate validation test removed

intercom-validation-test-5 was identical to intercom-validation-test-4 (same input, output and description) apart from its id.

What is the related Linear task?

Related to INT-7442

Please explain the objectives of your changes below

Make the Intercom processor tests test what their descriptions claim.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A — tests only.

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

N/A


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

Testing

  • Intercom component tests: 72/72 pass (73 before; the drop is the removed duplicate).
  • Intercom unit tests (src/cdk/v2/destinations/intercom): 54/54 pass.
  • Secret paths: regeneration leaves src/secretPaths/secretPaths.json unchanged.

🤖 Generated with Claude Code

…drop duplicate

The "No Version" identify tests (intercom-identify-test-11..13) set
`apiVersion: undefined` on the destination object instead of in Config, so
Config.apiVersion stayed 'v1' and they exercised v1 (/users, Intercom-Version
1.4). Their success criteria also claimed v1 is the default, while the
transform defaults to v2 when apiVersion is not set.

Give them a Config without apiVersion, expect the v2 output the transform
produces (/contacts, Intercom-Version 2.10, v2 payload), and add the contact
search mocks they need. Test 13 now uses a distinct email so its search finds
an existing contact and it covers the update path its description names.

Remove intercom-validation-test-5, an exact duplicate of
intercom-validation-test-4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 12:27
@krishna2020
krishna2020 requested review from a team as code owners October 29, 2026 12:27
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 599dd536-7a0d-4df4-9ee0-027918210e91

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified in the tests-only corrections to Intercom’s default-v2 coverage.

No open issues 🎉

What changed in this PR

This tests-only PR corrects Intercom processor coverage for configurations without apiVersion, verifying the existing v2 default without changing production behavior.

Changes:

  • Update three identify cases to omit Config.apiVersion and expect v2 contact creation or update payloads.
  • Add search mocks and distinct update-case input to exercise both paths.
  • Remove a duplicate validation test.
File Description
test/​integrations/​destinations/​intercom/​processor/​validationTestData.ts Removes duplicate missing-parameter validation coverage.
test/​integrations/​destinations/​intercom/​processor/​identifyTestData.ts Corrects missing-version fixtures, expectations, and descriptions for v2 behavior.
test/​integrations/​destinations/​intercom/​network.ts Adds contact-search mocks for the corrected create and update cases.

Review effort: Balanced

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (0f4947b) to head (e9e8dfd).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5749   +/-   ##
========================================
  Coverage    92.42%   92.42%           
========================================
  Files          741      741           
  Lines        41048    41048           
  Branches      9635     9634    -1     
========================================
  Hits         37938    37938           
  Misses        2848     2848           
  Partials       262      262           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@krishna2020 krishna2020 changed the title test(intercom): make "No Version" identify tests omit apiVersion and drop duplicate test(intercom): make no-version identify tests omit apiVersion and drop duplicate Oct 29, 2026
@krishna2020
krishna2020 merged commit 3dbb670 into develop Nov 3, 2026
40 checks passed
@krishna2020
krishna2020 deleted the test/intercom-processor-test-fixes branch November 3, 2026 06:34
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.

4 participants