Skip to content

Commit

Permalink
fix(amp): update test (#3022)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Dec 11, 2021
1 parent ae7f790 commit 5a6a2dc
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 7 deletions.
8 changes: 5 additions & 3 deletions packages/kit/test/apps/amp/src/routes/invalid/_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export default function (test, is_dev) {
if (is_dev) {
assert.equal(await page.textContent('h1'), 'AMP validation failed');

assert.ok(body.includes("The tag 'img' may only appear as a descendant of tag 'noscript'"));
assert.ok(body.includes('<img alt="A potato." src="potato.jpg">'));
assert.ok(
body.includes("Invalid URL protocol 'javascript:' for attribute 'href' in tag 'a'")
);
assert.ok(body.includes('<a href="javascript:void(0);">invalid</a>'));
} else {
assert.ok(body.includes('<img alt="A potato." src="potato.jpg">'));
assert.ok(body.includes('<a href="javascript:void(0);">invalid</a>'));
}
});
}
3 changes: 2 additions & 1 deletion packages/kit/test/apps/amp/src/routes/invalid/index.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<img alt="A potato." src="potato.jpg">
<!-- svelte-ignore a11y-invalid-attribute -->
<a href="javascript:void(0);">invalid</a>
220 changes: 217 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a6a2dc

Please sign in to comment.