Fix WithTestRegistry
so that feature flags apply to the callback
#10757
Labels
WithTestRegistry
so that feature flags apply to the callback
#10757
Uh oh!
There was an error while loading. Please reload this page.
Feature Description
As discussed here, using
WithTestRegistry
while providing a callback alongside a set of features can lead to unexpected results, because the features won't be enabled until after the callback has executed.This is illustrated with a contrived story in PR #10758, but as can be seen from the comment linked above it's something we've run into during active development.
We should ensure the features are enabled prior to the callback executing to reflect the real-world expectation of how features should be applied.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
WithTestRegistry
should be updated so that enabled features apply when executing the callback.Implementation Brief
features
prop fromWithTestRegistry
and instead importenabledFeatures
fromtests/js/utils.js
.features
prop toWithTestRegistry
to intead provide them via{Story}.parameters.features
, this will ensureenabledFeatures
is updated via this default decorator instorybook/preview.js
.Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: