Files
buzz/desktop/tests/helpers/features.ts
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w 0ca05eddc5 test(e2e): derive preview-feature list from features.json
Both the screenshot 'all on' test and the bridge mock seed were
hand-maintaining a parallel array of preview feature ids. tier
transitions (e.g. promoting huddles to stable) required updating
two places that the type system couldn't help us with.

Add tests/helpers/features.ts as a single source of truth that
imports /features.json directly and filters tier === 'preview'.
The 'all on' test now loops over PREVIEW_FEATURE_IDS, and bridge.ts
re-uses the same constant for its localStorage seeding.

12/12 screenshot-feature-flags tests pass locally.

Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
2026-06-08 13:02:59 -07:00

28 lines
892 B
TypeScript

// Single source of truth for E2E tests: derive the preview-feature list from
// /features.json so we don't have to hand-maintain a parallel array.
//
// Tier transitions (preview → stable, or new preview features added) are
// picked up automatically by every test that imports from here.
import featuresManifest from "../../../features.json" with { type: "json" };
interface FeatureDefinition {
id: string;
name: string;
description: string;
tier: "stable" | "preview";
platforms?: string[];
}
interface FeaturesManifest {
version: number;
features: FeatureDefinition[];
}
const manifest = featuresManifest as FeaturesManifest;
/** IDs of every preview-tier feature on desktop. */
export const PREVIEW_FEATURE_IDS: string[] = manifest.features
.filter((f) => f.tier === "preview")
.filter((f) => !f.platforms || f.platforms.includes("desktop"))
.map((f) => f.id);