Skip to content

Migrated LibraryInfo functional test to Vitest+Playwright+MSW#1536

Open
carterworks wants to merge 7 commits into
migrate-integration/00-infrafrom
migrate-integration/04-library-info
Open

Migrated LibraryInfo functional test to Vitest+Playwright+MSW#1536
carterworks wants to merge 7 commits into
migrate-integration/00-infrafrom
migrate-integration/04-library-info

Conversation

@carterworks

@carterworks carterworks commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Changed Packages

  • core
  • reactor-extension

Description

Migrates the LibraryInfo functional test 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/LibraryInfo/C2589.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: f9af505

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

Migrates the LibraryInfo functional test (C2589.js) from TestCafe to the Vitest+Playwright+MSW harness as one step in the broader functional→integration migration series.

  • Three tests are ported: the main getLibraryInfo assertion (version, commands, configs), function serialization, and postMessage structured-clone safety; all use the standard alloy auto-fixture from extend.js.
  • sendConversationEvent is added to EXPECTED_COMMANDS — this intentionally reflects the current library surface and explains why the original functional test was listed as a baseline failure.
  • Config assertion is changed from strict eql to toMatchObject (subset check), consistent with the migration pattern that allows new config fields to be added without breaking the test.

Confidence Score: 5/5

Safe to merge — the change is a test-only addition with no production code changes.

All three tests correctly replicate the intent of the original functional tests. The auto-fixture in extend.js ensures proper teardown between tests, each test issues its own configure call, and the postMessage test correctly validates structured-clone safety synchronously. No production code is modified.

No files require special attention.

Important Files Changed

Filename Overview
packages/browser/test/integration/specs/LibraryInfo/libraryInfo.spec.js New integration spec migrating C2589 from TestCafe to Vitest+Playwright+MSW; adds sendConversationEvent to expected commands (reflecting current API state), switches config assertion to toMatchObject, and correctly tests function serialization and postMessage clonability.

Sequence Diagram

sequenceDiagram
    participant Test as Vitest Test
    participant Fixture as alloy fixture (extend.js)
    participant Alloy as window.alloy
    participant MSW as MSW Worker

    Fixture->>Fixture: clear kndctr_/AMCV_ cookies
    Fixture->>Fixture: setupBaseCode() + setupAlloy()
    Fixture->>Test: use(alloy)

    Test->>Alloy: "configure({orgId, datastreamId, ...})"
    Alloy-->>Test: resolved

    Test->>Alloy: getLibraryInfo()
    Alloy-->>Test: "{ libraryInfo }"

    Note over Test: delete libraryInfo.configs.edgeBasePath
    Test->>Test: expect(version).toBe(LIBRARY_VERSION)
    Test->>Test: expect(commands).toEqual(EXPECTED_COMMANDS)
    Test->>Test: "expect(configs).toMatchObject({...})"

    Test-->>Fixture: done
    Fixture->>Fixture: cleanAlloy()
Loading

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

@carterworks carterworks force-pushed the migrate-integration/03-logging branch from 19ba2a4 to f847fde Compare June 12, 2026 17:31
@carterworks carterworks force-pushed the migrate-integration/04-library-info branch from 6d4a68b to 71ad5f5 Compare June 12, 2026 17:31
This was referenced Jun 12, 2026
@carterworks carterworks force-pushed the migrate-integration/03-logging branch from f847fde to c698d64 Compare June 12, 2026 17:55
@carterworks carterworks force-pushed the migrate-integration/04-library-info branch from 71ad5f5 to 10f1006 Compare June 12, 2026 17:55

@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/03-logging 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/04-library-info branch 4 times, most recently from 30223eb to a721189 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/04-library-info branch from a721189 to b06f1f9 Compare June 15, 2026 19:59
@carterworks carterworks marked this pull request as ready for review June 16, 2026 15:45
@carterworks carterworks force-pushed the migrate-integration/04-library-info branch from 3341ffb to 31fe886 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