| layouts/_partials/site-footer.html | ●●●●● patch | view | raw | blame | history | |
| tests/e2e/footer.spec.ts | ●●●●● patch | view | raw | blame | history |
layouts/_partials/site-footer.html
@@ -1,8 +1,8 @@ <footer class="{{ .Site.Params.background_color_class | compare.Default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo"> <div class="flex justify-between"> <a class="f4 fw4 hover-white white-70 dn dib-ns pv2 ph3 no-underline" href="{{ .Site.Home.Permalink }}" > <div class="flex flex-wrap justify-between"> <a class="f4 fw4 hover-white white-70 dib pv2 ph3 no-underline" href="{{ .Site.Home.Permalink }}" > © {{ with .Site.Copyright | compare.Default .Site.Title }} {{ . | safe.HTML }} {{ now.Format "2006"}} {{ end }} </a> <div>{{ partials.IncludeCached "social/follow.html" . }}</div> <div class="ph3 ph0-ns">{{ partials.IncludeCached "social/follow.html" . }}</div> </div> </footer> tests/e2e/footer.spec.ts
New file @@ -0,0 +1,20 @@ import { expect, test } from "@playwright/test"; for (const width of [375, 1280]) { test(`footer shows the copyright at ${width}px (#449)`, async ({ page }) => { await page.setViewportSize({ width, height: 900 }); await page.goto("/"); const footer = page.getByRole("contentinfo"); const copyright = footer.getByRole("link", { name: /©/ }); await expect(copyright).toBeVisible(); const footerBox = await footer.boundingBox(); const linkBox = await copyright.boundingBox(); expect(linkBox).not.toBeNull(); expect(footerBox).not.toBeNull(); if (linkBox && footerBox) { expect(linkBox.x + linkBox.width).toBeLessThanOrEqual( footerBox.x + footerBox.width, ); } }); }