Prevent ViewTransition script from being added by mistake (#8268) (#8270)

* Prevent ViewTransition script from being added by mistake

* Add the 2-legacy branch to CI
This commit is contained in:
Matthew Phillips 2023-08-29 14:00:47 -04:00 committed by GitHub
parent 8450379db8
commit e7f872e91e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Prevent ViewTransition script from being added by mistake

View file

@ -5,6 +5,7 @@ on:
branches:
- main
- "1-legacy"
- "2-legacy"
- next
defaults:

View file

@ -1,3 +1,2 @@
export { default as Code } from './Code.astro';
export { default as Debug } from './Debug.astro';
export { default as ViewTransitions } from './ViewTransitions.astro';

View file

@ -23,4 +23,11 @@ describe('Code component', () => {
let $ = cheerio.load(html);
expect($('pre').attr('is:raw')).to.equal(undefined);
});
// ViewTransitions bug
it('No script should be added to the page', async () => {
let html = await fixture.readFile('/index.html');
let $ = cheerio.load(html);
expect($('script')).to.have.a.lengthOf(0);
});
});