Scenes: Fix timezone not being preserved in links (#112879)

* Scenes: Fix timezone not being preserved in links

* Update E2E
This commit is contained in:
Ivan Ortega Alba
2025-10-29 17:15:16 +00:00
committed by GitHub
parent 0124aab805
commit 6a3e95913e
3 changed files with 15 additions and 20 deletions
@@ -19,9 +19,7 @@ test.describe(
// Open dashboard global variables and interpolation
await gotoDashboardPage({ uid: DASHBOARD_UID });
// Get the actual timezone from the browser context (should be Pacific/Easter due to test.use)
const timeZone = await page.evaluate(() => Intl.DateTimeFormat().resolvedOptions().timeZone);
const example = `Example: from=now-6h&to=now&timezone=${encodeURIComponent(timeZone)}`;
const example = `Example: from=now-6h&to=now&timezone=browser`;
const expectedItems: string[] = [
'__dashboard = Templating - Global variables and interpolation',
@@ -68,10 +66,7 @@ test.describe(
// Check link interpolation is working correctly
const exampleLink = page.locator(`a:has-text("${example}")`);
await expect(exampleLink).toHaveAttribute(
'href',
`https://example.com/?from=now-6h&to=now&timezone=${encodeURIComponent(timeZone)}`
);
await expect(exampleLink).toHaveAttribute('href', `https://example.com/?from=now-6h&to=now&timezone=browser`);
});
}
);