fix(feature-flags): repair e2e tests broken by Products module removal#213
Merged
Conversation
When the Products module was removed (b269896), its ProductsFeatures class (which implemented IModuleFeatures) was deleted. This left IFeatureFlagRegistry empty at runtime, so GET /api/feature-flags always returned [] — causing all 4 feature-flags-crud e2e tests to fail at the first assertion. Fix: add FeatureFlagsFeatures : IModuleFeatures to FeatureFlags.Contracts so the registry always contains at least one flag (FeatureFlags.OverrideManagement). The source generator auto-registers it, and GetAllFlagsAsync returns it from the in-memory registry even before FeatureFlagSyncService persists it to the DB. Also update both playwright.config.ts files to read PLAYWRIGHT_BASE_URL from the environment, enabling parallel agent test runs on separate ports.
Deploying simplemodule-website with
|
| Latest commit: |
8f9998d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f9435882.simplemodule-website.pages.dev |
| Branch Preview URL: | https://fix-feature-flags-e2e.simplemodule-website.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProductsFeatures : IModuleFeaturesclass was deleted. This leftIFeatureFlagRegistryempty at runtime —GET /api/feature-flagsalways returned[]— causing all 4 e2e tests to fail atexpect(flags.length).toBeGreaterThan(0).FeatureFlagsFeatures : IModuleFeaturestoFeatureFlags.Contractswith one flag (FeatureFlags.OverrideManagement). The source generator auto-registers it.GetAllFlagsAsyncreads from the in-memory registry, so the flag is returned even before the sync service persists it to the DB.playwright.config.tsfiles now readPLAYWRIGHT_BASE_URLfrom the environment, enabling parallel agent test runs on different ports without hard-coded 5001.Test plan
npx playwright test tests/e2e/tests/flows/feature-flags-crud.spec.ts --reporter=line --project=chromium→ 5/5 pass (including auth setup)npx biome check tests/e2e/ modules/FeatureFlags/→ clean (0 errors)dotnet build template/SimpleModule.Host→ Build succeeded, 0 warnings