From c934b087d738401f2394c3738d156993e66b4b64 Mon Sep 17 00:00:00 2001 From: matthewp Date: Mon, 11 Sep 2023 12:41:49 +0000 Subject: [PATCH] [ci] format --- packages/astro/components/ViewTransitions.astro | 14 ++++++++------ packages/astro/e2e/view-transitions.test.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index 822be5ccb..4d615188d 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -114,7 +114,7 @@ const { fallback = 'animate' } = Astro.props as Props; const parser = new DOMParser(); // A noop element used to prevent styles from being removed - if(import.meta.env.DEV) { + if (import.meta.env.DEV) { var noopEl: string | undefined = document.createElement('div'); } @@ -145,13 +145,15 @@ const { fallback = 'animate' } = Astro.props as Props; } } // Only run this in dev. This will get stripped from production builds and is not needed. - if(import.meta.env.DEV) { - if(el.tagName === 'STYLE' && el.dataset.viteDevId) { + if (import.meta.env.DEV) { + if (el.tagName === 'STYLE' && el.dataset.viteDevId) { const devId = el.dataset.viteDevId; // If this same style tag exists, remove it from the new page - return doc.querySelector(`style[data-astro-dev-id="${devId}"]`) - // Otherwise, keep it anyways. This is client:only styles. - || noopEl; + return ( + doc.querySelector(`style[data-astro-dev-id="${devId}"]`) || + // Otherwise, keep it anyways. This is client:only styles. + noopEl + ); } } return null; diff --git a/packages/astro/e2e/view-transitions.test.js b/packages/astro/e2e/view-transitions.test.js index bd8ad5c36..64041ab05 100644 --- a/packages/astro/e2e/view-transitions.test.js +++ b/packages/astro/e2e/view-transitions.test.js @@ -566,7 +566,7 @@ test.describe('View Transitions', () => { await expect(p, 'should have content').toHaveText('Page 1'); }); - test("client:only styles are retained on transition", async ({ page, astro }) => { + test('client:only styles are retained on transition', async ({ page, astro }) => { const totalExpectedStyles = 8; // Go to page 1