[ci] format

This commit is contained in:
matthewp 2023-09-11 12:41:49 +00:00 committed by astrobot-houston
parent fa77fa63d9
commit c934b087d7
2 changed files with 9 additions and 7 deletions

View file

@ -149,9 +149,11 @@ const { fallback = 'animate' } = Astro.props as Props;
if (el.tagName === 'STYLE' && el.dataset.viteDevId) { if (el.tagName === 'STYLE' && el.dataset.viteDevId) {
const devId = el.dataset.viteDevId; const devId = el.dataset.viteDevId;
// If this same style tag exists, remove it from the new page // If this same style tag exists, remove it from the new page
return doc.querySelector(`style[data-astro-dev-id="${devId}"]`) return (
doc.querySelector(`style[data-astro-dev-id="${devId}"]`) ||
// Otherwise, keep it anyways. This is client:only styles. // Otherwise, keep it anyways. This is client:only styles.
|| noopEl; noopEl
);
} }
} }
return null; return null;

View file

@ -566,7 +566,7 @@ test.describe('View Transitions', () => {
await expect(p, 'should have content').toHaveText('Page 1'); 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; const totalExpectedStyles = 8;
// Go to page 1 // Go to page 1