summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Martin Trapp <94928215+martrapp@users.noreply.github.com> 2023-09-20 11:50:56 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-20 17:50:56 +0800
commit2d7f5429a5cb3555d0bc15eaaa936b3aaa877891 (patch)
tree3c03068fdea11bca5781015c25b28717921b11e5
parent70f2a80039d232731f63ea735e896997ec0eac7a (diff)
downloadastro-2d7f5429a5cb3555d0bc15eaaa936b3aaa877891.tar.gz
astro-2d7f5429a5cb3555d0bc15eaaa936b3aaa877891.tar.zst
astro-2d7f5429a5cb3555d0bc15eaaa936b3aaa877891.zip
test: since we check the media-type, data-astro-reload has fewer use cases (#8605)
-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,