Skip to content

fix(testing): point ab-testing at the fixture method that exists - #161

Draft
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/ab-testing-fixture-method
Draft

MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/ab-testing-fixture-method

Conversation

@MajorLift

Copy link
Copy Markdown
Contributor

Motivation

The ab-testing extension overlay tells an agent writing a flag-gated test to call FixtureBuilder.withRemoteFeatureFlags(...). That method does not exist in metamask-extension, so a test written from the overlay fails before it runs.

Overview

Replaces it with the method specs actually use, withRemoteFeatureFlagController on FixtureBuilderV2, with its real argument shape. The flags nest under remoteFeatureFlags, which renaming the method alone would have left out.

The other override in the same sentence, manifestFlags.remoteFeatureFlags, is correct and unchanged.

Showcase

Read at metamask-extension 0269fae:

  • class FixtureBuilderV2 is declared at fixture-builder-v2.ts:178, and withRemoteFeatureFlagController(data: Partial<RemoteFeatureFlagControllerState>) at fixture-builder-v2.ts:428.
  • Specs call it with the flags nested under remoteFeatureFlags, for example money-account-vault-restore.spec.ts:120.
  • No .ts file outside test/e2e/feature-flags/feature-flag-registry.ts defines or calls withRemoteFeatureFlags(. The same search for withRemoteFeatureFlagController( returns 8 matching lines, so the search shape finds the method that does exist.

The overlay's wording matches two doc comments in that registry, at line 17 and line 3561, which is the likely origin. Those comments live in metamask-extension and are not changed here.

`FixtureBuilder.withRemoteFeatureFlags(...)` does not exist in
`metamask-extension`. Specs call `withRemoteFeatureFlagController` on
`FixtureBuilderV2`, with the flags nested under `remoteFeatureFlags`, so the
argument shape changes along with the name.
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.

1 participant