summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/components/ViewTransitions.astro3
-rw-r--r--packages/astro/e2e/view-transitions.test.js6
2 files changed, 5 insertions, 4 deletions
diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro
index 8e233d182..05fc57aa6 100644
--- a/packages/astro/components/ViewTransitions.astro
+++ b/packages/astro/components/ViewTransitions.astro
@@ -265,8 +265,7 @@ const { fallback = 'animate' } = Astro.props as Props;
link.origin === location.origin &&
!(
// Same page means same path and same query params
- location.pathname === link.pathname &&
- location.search === link.search
+ (location.pathname === link.pathname && location.search === link.search)
) &&
ev.button === 0 && // left clicks only
!ev.metaKey && // new tab (mac)
diff --git a/packages/astro/e2e/view-transitions.test.js b/packages/astro/e2e/view-transitions.test.js
index d9425118d..7aeb6502a 100644
--- a/packages/astro/e2e/view-transitions.test.js
+++ b/packages/astro/e2e/view-transitions.test.js
@@ -295,7 +295,10 @@ test.describe('View Transitions', () => {
await expect(meta).toHaveAttribute('content', '0');
});
- test('Navigating to the same path but with different query params should result in transition', async ({ page, astro }) => {
+ test('Navigating to the same path but with different query params should result in transition', async ({
+ page,
+ astro,
+ }) => {
const loads = [];
page.addListener('load', (p) => {
loads.push(p.title());
@@ -311,7 +314,6 @@ test.describe('View Transitions', () => {
p = page.locator('#query-page');
await expect(p, 'should have content').toHaveText('Page 2');
-
await expect(loads.length, 'There should only be 1 page load').toEqual(1);
});
});