Skip to content

Migrated Config Overrides functional tests to Vitest+Playwright+MSW#1538

Open
carterworks wants to merge 5 commits into
migrate-integration/00-infrafrom
migrate-integration/06-config-overrides
Open

Migrated Config Overrides functional tests to Vitest+Playwright+MSW#1538
carterworks wants to merge 5 commits into
migrate-integration/00-infrafrom
migrate-integration/06-config-overrides

Conversation

@carterworks

@carterworks carterworks commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Changed Packages

  • core
  • reactor-extension

Description

Migrates the Config Overrides functional tests to the new Vitest+Playwright+MSW harness.

Related Issue

Part of the functional test → integration test migration. See packages/browser/test/FUNCTIONAL_MIGRATION_PLAN.md.

Motivation and Context

The existing TestCafe functional test suite is being migrated to Vitest+Playwright+MSW to enable faster, more reliable CI testing without a running server. This PR is part of a stacked series — each PR migrates one test file.

Functional tests replaced:

  • packages/browser/test/functional/specs/Config Overrides/C7437530.js
  • packages/browser/test/functional/specs/Config Overrides/C7437531.js
  • packages/browser/test/functional/specs/Config Overrides/C7437532.js
  • packages/browser/test/functional/specs/Config Overrides/C7437533.js

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have added a Changeset file with a consumer-facing description of my changes.
  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.

Stack

  1. Added MSW handlers, mock fixtures, and Vitest+Playwright test harness for functional test migration #1532
  2. Migrated Install SDK functional tests to Vitest+Playwright+MSW #1533

@carterworks carterworks added the ignore-for-release Do not include this PR in release notes label Jun 12, 2026
@carterworks carterworks self-assigned this Jun 12, 2026
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a867ead

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a single Vitest+Playwright+MSW integration spec that replaces four TestCafe functional test files (C7437530–C7437533) covering config-override payload forwarding for sendEvent, getIdentity, appendIdentityToUrl, and setConsent.

  • All 22 migrated test scenarios are structurally correct and use the new harness conventions (worker.use, networkRecorder.findCall, MSW handlers) consistently.
  • The "empty config override values" tests for getIdentity, appendIdentityToUrl, and setConsent contain only a negative assertion (com_adobe_target is undefined) and omit any positive assertion confirming that the remaining valid overrides are still forwarded; this narrows the regression surface compared to the originals, which verified all four override fields in that scenario.
  • The setConsent "command overrides take precedence" test reverses the configure/command override assignment relative to the equivalent sendEvent, getIdentity, and appendIdentityToUrl tests (though the logic it tests remains correct).

Confidence Score: 4/5

Safe to merge with low risk; the only defect is in the migrated tests themselves, not production code.

The empty-override tests for getIdentity, appendIdentityToUrl, and setConsent each rely solely on a negative assertion, meaning a regression where valid overrides are silently dropped for those commands would pass undetected. All production-path logic is unchanged and the test harness is used correctly throughout.

The three empty config override values test blocks in configOverridesPayload.spec.js (~lines 240, 338, 462) need a positive assertion added alongside the existing negative one.

Important Files Changed

Filename Overview
packages/browser/test/integration/specs/Config Overrides/configOverridesPayload.spec.js New integration spec migrating 4 TestCafe files (C7437530–C7437533) to Vitest+Playwright+MSW; all 22 scenarios are structurally correct but the empty config override values tests for getIdentity, appendIdentityToUrl, and setConsent omit positive assertions, leaving a gap compared to the originals.

Sequence Diagram

sequenceDiagram
    participant Test as Vitest Test
    participant Alloy as Alloy SDK (Browser)
    participant MSW as MSW Worker
    participant NR as NetworkRecorder

    Test->>Alloy: configure(alloyConfig [+ edgeConfigOverrides])
    Test->>Alloy: sendEvent / getIdentity / appendIdentityToUrl / setConsent [+ edgeConfigOverrides]
    Alloy->>MSW: POST /v1/interact (or /acquire, /set-consent) with meta.configOverrides merged
    MSW-->>Alloy: Mocked response (200)
    Alloy-->>Test: Command resolves
    Test->>NR: findCall(urlRegex)
    NR-->>Test: Recorded request
    Test->>Test: "expect(meta.configOverrides.*) assertions"
Loading

Reviews (2): Last reviewed commit: "test(integration): migrate config overri..." | Re-trigger Greptile

@carterworks carterworks force-pushed the migrate-integration/05-location-hints branch from 2fb56e2 to e183d80 Compare June 12, 2026 17:31
@carterworks carterworks force-pushed the migrate-integration/06-config-overrides branch from fe8d1b8 to 15655d5 Compare June 12, 2026 17:31
This was referenced Jun 12, 2026
@carterworks carterworks force-pushed the migrate-integration/05-location-hints branch from e183d80 to 8aa9f6b Compare June 12, 2026 17:56
@carterworks carterworks force-pushed the migrate-integration/06-config-overrides branch from 15655d5 to c1b8db1 Compare June 12, 2026 17:56

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

carterworks has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@carterworks carterworks changed the base branch from migrate-integration/05-location-hints to migrate-integration/00-infra June 12, 2026 17:57

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

carterworks has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@carterworks carterworks force-pushed the migrate-integration/06-config-overrides branch 4 times, most recently from b0138f0 to a378e25 Compare June 12, 2026 21:20
@carterworks carterworks marked this pull request as draft June 15, 2026 16:38
@carterworks carterworks force-pushed the migrate-integration/06-config-overrides branch from a378e25 to 597c00f Compare June 15, 2026 19:59
@carterworks carterworks marked this pull request as ready for review June 16, 2026 17:36
carterworks and others added 4 commits June 26, 2026 14:19
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arity

Several 'from configure', 'takes precedence', and 'empty values' tests
were only asserting 1-2 override fields. Bring all four suites
(sendEvent, getIdentity, appendIdentityToUrl, setConsent) to parity with
the original TestCafe tests by asserting all four override fields:
com_adobe_experience_platform, com_adobe_analytics, com_adobe_identity,
and com_adobe_target.
@carterworks carterworks force-pushed the migrate-integration/06-config-overrides branch from ca06bde to e8e2e7d Compare June 26, 2026 20:19
Keep the original testcafe functional specs alongside the new
Vitest+Playwright+MSW integration suite until these migration branches
merge, so reviewers retain the pre-migration signal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Do not include this PR in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant