Skip to content

Add useFakeFeatures test helper#2434

Merged
tf merged 1 commit into
codevise:masterfrom
tf:use-fake-features
Jun 9, 2026
Merged

Add useFakeFeatures test helper#2434
tf merged 1 commit into
codevise:masterfrom
tf:use-fake-features

Conversation

@tf

@tf tf commented Jun 9, 2026

Copy link
Copy Markdown
Member

Bundle the feature-flag enable + restore dance that several specs currently repeat (beforeEach(() => features.enable(...)) paired with afterEach(() => features.enabledFeatureNames = [])) into a single hook taking the same (scope, names) signature as features.enable. The afterEach snapshots and restores the previous enabled set instead of clearing unconditionally, so multiple useFakeFeatures calls compose across nested describes the same way useFakeTranslations does.

Adopt the helper in the four specs (commentBadges, ContentElement, InlineImage, ExternalLink) that already followed the before-hook setup pattern.

Bundle the feature-flag enable + restore dance that several specs
currently repeat (`beforeEach(() => features.enable(...))` paired
with `afterEach(() => features.enabledFeatureNames = [])`) into a
single hook taking the same `(scope, names)` signature as
`features.enable`. The afterEach snapshots and restores the
previous enabled set instead of clearing unconditionally, so multiple
`useFakeFeatures` calls compose across nested describes the same way
`useFakeTranslations` does.

Adopt the helper in the four specs (commentBadges, ContentElement,
InlineImage, ExternalLink) that already followed the before-hook
setup pattern.
@tf tf added this to the v17.2 milestone Jun 9, 2026
@tf tf merged commit e3e00dc into codevise:master Jun 9, 2026
16 checks passed
@tf tf deleted the use-fake-features branch June 9, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant