mk6umpwt1: Keep the delete error clear of the text-only quote

This commit is contained in:
2026-10-20 10:44:10 -06:00
parent 048b8ec8d1
commit c40d96c713
6 changed files with 49 additions and 6 deletions
+21
View File
@@ -257,3 +257,24 @@ describe("long post text stylesheet", () => {
expect(css).toMatch(/prefers-reduced-motion: reduce\) \{[^}]*\.slide-reader,\s*\.slide-text\.is-open,/);
});
});
describe("delete error on a text-only slide", () => {
const css = readFileSync("src/styles/mobile.css", "utf8");
const slideOf = (html: string) => html.split("<section").filter((s) => s.includes('data-testid="feed-slide"'));
it("marks only the slide with the error so the quote box can end above it", () => {
const html = render({ deleteErrors: new Set([POSTS[0].key]) });
const [own, image] = slideOf(html);
expect(own).toContain("slide-has-error");
expect(own).toContain("Could not delete the post.");
expect(image).not.toContain("slide-has-error");
expect(slideOf(render({}))[0]).not.toContain("slide-has-error");
});
it("lifts the quote box by the error line and its gap", () => {
const base = Number(/\.slide-quote-w \{[^}]*?bottom: (\d+)px/.exec(css)![1]);
const withError = Number(/\.slide-has-error \.slide-quote-w \{ bottom: (\d+)px; \}/.exec(css)![1]);
const line = Number(/\.slide-error \{[^}]*?line-height: (\d+)px/.exec(css)![1]);
expect(withError).toBe(base + line + 12);
});
});