Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin E2E: Fix isFeatureEnabled fixture #691

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

sunker
Copy link
Contributor

@sunker sunker commented Jan 23, 2024

What this PR does / why we need it:

While adding support for substituting feature toggles during a test session, overrides were set in local storage (when Grafana version is => 10.1.0). I did not think about the fact that we have a fixture called isFeatureEnabled. If overrides aren't propagated to window.grafanaBootData.settings.featureToggles, there's no way for this fixture to know weather a FE feature is enabled or not. This PR ensures overrides are added directly to window.grafanaBootData.settings.featureToggles, which will fix the broken isFeatureEnabled fixture.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/plugin-e2e@0.10.1-canary.691.5a4661c.0
# or 
yarn add @grafana/plugin-e2e@0.10.1-canary.691.5a4661c.0

Copy link

github-actions bot commented Jan 23, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

@sunker sunker added patch Increment the patch version when merged release Create a release when this pr is merged labels Jan 23, 2024
@sunker sunker marked this pull request as ready for review January 23, 2024 15:50
@sunker sunker requested a review from a team as a code owner January 23, 2024 15:50
@sunker sunker requested review from jackw and academo and removed request for a team January 23, 2024 15:50
@@ -24,6 +24,7 @@ const page: PageFixture = async ({ page, featureToggles }, use) => {
console.error('Failed to set feature toggles', error);
}
}
await page.goto('/');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Load start page so that page init scripts is executed before other fixtures.

@sunker sunker merged commit 95270a4 into main Jan 23, 2024
22 of 24 checks passed
@sunker sunker deleted the plugin-e2e/fix-is-feature-enabled branch January 23, 2024 20:20
@grafana-plugins-platform-bot
Copy link

🚀 PR was released in @grafana/plugin-e2e@0.10.1 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants