diff options
Diffstat (limited to 'packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro')
-rw-r--r-- | packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro b/packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro new file mode 100644 index 000000000..1c4950a2f --- /dev/null +++ b/packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro @@ -0,0 +1,28 @@ +--- +import Layout from "../layout/Layout.astro"; +--- + +<Layout> +<button id="bad-button">Click me to add an image that is missing an alt!</button> +<a id="link-to-2" href="/audits-mutations-2">Go to Mutations 2</a> + +<img src="" width="100" height="100" /> + +<script> + document.addEventListener('astro:page-load', () => { + const badButton = document.getElementById('bad-button'); + if (!badButton) return; + + badButton.addEventListener('click', clickHandler); + + function clickHandler() { + const img = document.createElement('img'); + img.width = 100; + img.height = 100; + + document.body.appendChild(img); + console.log("Image added to the page") + } + }) +</script> +</Layout> |