summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/e2e/fixtures/view-transitions/src/pages/four.astro1
-rw-r--r--packages/astro/e2e/view-transitions.test.js16
2 files changed, 17 insertions, 0 deletions
diff --git a/packages/astro/e2e/fixtures/view-transitions/src/pages/four.astro b/packages/astro/e2e/fixtures/view-transitions/src/pages/four.astro
index c6547dc20..82dda9475 100644
--- a/packages/astro/e2e/fixtures/view-transitions/src/pages/four.astro
+++ b/packages/astro/e2e/fixtures/view-transitions/src/pages/four.astro
@@ -11,4 +11,5 @@ import Layout from '../components/Layout.astro';
</a>
<a id="click-two" href="/two" data-astro-reload>load page / no navigation</a>
<a id="click-logo" href="/logo.svg" download>load page / no navigation</a>
+ <a id="click-svg" href="/logo.svg">load page / no navigation</a>
</Layout>
diff --git a/packages/astro/e2e/view-transitions.test.js b/packages/astro/e2e/view-transitions.test.js
index 868660f9f..fb609443f 100644
--- a/packages/astro/e2e/view-transitions.test.js
+++ b/packages/astro/e2e/view-transitions.test.js
@@ -520,6 +520,22 @@ test.describe('View Transitions', () => {
await downloadPromise;
});
+ test('data-astro-reload not required for non-html content', async ({ page, astro }) => {
+ const loads = [];
+ page.addListener('load', (p) => {
+ loads.push(p.title());
+ });
+ // Go to page 4
+ await page.goto(astro.resolveUrl('/four'));
+ let p = page.locator('#four');
+ await expect(p, 'should have content').toHaveText('Page 4');
+
+ await page.click('#click-svg');
+ p = page.locator('svg');
+ await expect(p).toBeVisible();
+ expect(loads.length, 'There should be 2 page load').toEqual(2);
+ });
+
test('Scroll position is restored on back navigation from page w/o ViewTransitions', async ({
page,
astro,