@grafana/plugin-e2e 3.9.2 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fixtures/page.js +6 -0
- package/package.json +1 -1
package/dist/fixtures/page.js
CHANGED
|
@@ -13,6 +13,12 @@ const page = async ({ page: page2, featureToggles, openFeature: openFeature$1, u
|
|
|
13
13
|
if (hasFeatureToggles || hasUserPreferences) {
|
|
14
14
|
try {
|
|
15
15
|
await page2.addInitScript(overrideGrafanaBootData.overrideGrafanaBootData, { featureToggles, userPreferences });
|
|
16
|
+
await page2.route("**/apis/preferences.grafana.app/*/namespaces/*/preferences/merged", async (route) => {
|
|
17
|
+
const response = await route.fetch();
|
|
18
|
+
const json = await response.json();
|
|
19
|
+
json.spec = { ...json.spec, ...userPreferences };
|
|
20
|
+
await route.fulfill({ response, json });
|
|
21
|
+
});
|
|
16
22
|
} catch (error) {
|
|
17
23
|
console.error("Failed to set feature toggles", error);
|
|
18
24
|
}
|