Remove Ketch consent banners
This commit is contained in:
@@ -100,6 +100,34 @@ test("renderPage removes common cookie consent overlays before snapshot", async
|
||||
assert.doesNotMatch(rendered, /<body[^>]*class="[^"]*didomi-popup-open/i);
|
||||
});
|
||||
|
||||
test("renderPage removes Ketch consent banners before snapshot", async () => {
|
||||
const html = `<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<main>Article text</main>
|
||||
<div id="lanyard_root">
|
||||
<div id="ketch-banner" style="position: fixed; bottom: 0; left: 0; right: 0; z-index: 2147483647;">
|
||||
<div id="ketch-consent-banner" role="dialog" aria-label="privacy banner">
|
||||
<p>We and our vendors use tracking technologies to recognize visitors.</p>
|
||||
<button id="ketch-banner-button-tertiary" aria-label="Reject Non-Essential Cookies">
|
||||
Reject Non-Essential Cookies
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
const rendered = await renderPage(`data:text/html,${encodeURIComponent(html)}`, {
|
||||
userscriptDelay: 0
|
||||
});
|
||||
|
||||
assert.match(rendered, /Article text/);
|
||||
assert.doesNotMatch(rendered, /id="ketch-/);
|
||||
assert.doesNotMatch(rendered, /Reject Non-Essential Cookies/);
|
||||
assert.doesNotMatch(rendered, /tracking technologies/);
|
||||
});
|
||||
|
||||
test("renderPage removes Admiral adblock walls before snapshot", async () => {
|
||||
const html = `<!doctype html>
|
||||
<html style="overflow: hidden;">
|
||||
|
||||
Reference in New Issue
Block a user