Put the four Learn guides back in reading order and split the two run-on Avoiding Burnout sentences.

This commit is contained in:
adilallo committed 2026-11-12 17:50:40 -07:00
1 parent 3df3da7a91
commit 9a9358ad46
6 files changed
+125 -16

No files matched your search

+109
View File
@@ -0,0 +1,109 @@
import { readFileSync } from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";
const BLOG_DIR = path.join(process.cwd(), "content/blog");
function readGuide(slug: string): string {
return readFileSync(path.join(BLOG_DIR, `${slug}.md`), "utf8");
}
function bodyAfterFrontmatter(markdown: string): string {
return markdown.replace(/^---[\s\S]*?---\n*/, "").trim();
}
function lastParagraph(markdown: string): string {
const body = bodyAfterFrontmatter(markdown);
const paragraphs = body.split(/\n\n+/).map((paragraph) => paragraph.trim());
return paragraphs[paragraphs.length - 1] ?? "";
}
describe("Learn guide copy", () => {
it("splits the two broken Avoiding Burnout sentences", () => {
const body = bodyAfterFrontmatter(
readGuide("avoiding-burnout-sustainability-in-the-ruins"),
);
expect(body).toContain(
`Not "take a break when you need it." No one ever needs it`,
);
expect(body).not.toContain(
`Not "take a break when you need it" no one ever needs it`,
);
expect(body).toContain(
"running the communication channels. All of it rotates",
);
expect(body).not.toContain(
"running the communication channels all of it rotates",
);
});
it("ends How Chaos Concentrates Control on its closing line and keeps Rotate them after the named roles", () => {
const body = bodyAfterFrontmatter(readGuide("how-chaos-concentrates-control"));
const roles =
"Name the roles explicitly. Note-taker, treasurer, communications coordinator, whatever you need.";
const rotateThem = "Rotate them. Six months, a year, whatever makes sense.";
const closing =
"Build structures. Make them visible. Change them when they don't work. That's not selling out, that's how you build something that lasts.";
expect(body.indexOf(roles)).toBeGreaterThan(-1);
expect(body.indexOf(rotateThem)).toBeGreaterThan(body.indexOf(roles));
expect(body.indexOf(closing)).toBeGreaterThan(body.indexOf(rotateThem));
expect(lastParagraph(body)).toBe(closing);
expect(body.indexOf("Name who can bring proposals")).toBeLessThan(
body.indexOf(closing),
);
expect(body.indexOf("Make information accessible")).toBeLessThan(
body.indexOf(closing),
);
});
it("opens Digital Mediation on the setup and ends on its closing line", () => {
const body = bodyAfterFrontmatter(
readGuide("digital-mediation-and-the-death-of-nuance"),
);
const setup = "Your organizing group lives in a Discord server.";
const thesis = "This isn't neutral.";
const closing =
"The anti-social network isn't about rejecting technology. It's about refusing to let corporate platforms mediate all human connection and political organizing. It's about building tools that serve us rather than extract from us. It's about remembering that the most important networks are the ones between actual people, in actual space, building actual power together.";
expect(body.startsWith(setup)).toBe(true);
expect(body.indexOf(thesis)).toBeGreaterThan(body.indexOf(setup));
expect(lastParagraph(body)).toBe(closing);
});
it("ends Knowledge Management on its closing line after the five restored paragraphs", () => {
const body = bodyAfterFrontmatter(
readGuide("knowledge-management-and-institutional-amnesia"),
);
const firstRestored =
"The critical distinction: these repositories contain procedures, not personal data.";
const lastRestored =
"The open source model offers useful parallels here.";
const closing =
"Documentation isn't about bureaucracy. It's about refusing to let hard-won knowledge disappear when it could help the next person trying to do the work. It's about building organizations that can outlast any individual member. It's about sustainability in the ruins.";
expect(body.indexOf(firstRestored)).toBeGreaterThan(-1);
expect(body.indexOf(lastRestored)).toBeGreaterThan(body.indexOf(firstRestored));
expect(body.indexOf(closing)).toBeGreaterThan(body.indexOf(lastRestored));
expect(lastParagraph(body)).toBe(closing);
});
it("moves the Integrating New Members wrap-up after the three sections that followed it", () => {
const body = bodyAfterFrontmatter(
readGuide("integrating-new-members-without-dilution"),
);
const staged = "Staged responsibility means not giving new people important roles immediately.";
const redundant = "Making knowledge redundant matters because if one person holds crucial knowledge";
const split = "Split into smaller working groups with real autonomy.";
const wrapUp = "These practices make change manageable.";
const closing =
"You need more people. You need them to actually become part of what you're building. This is how.";
expect(body.indexOf(staged)).toBeGreaterThan(-1);
expect(body.indexOf(redundant)).toBeGreaterThan(body.indexOf(staged));
expect(body.indexOf(split)).toBeGreaterThan(body.indexOf(redundant));
expect(body.indexOf(wrapUp)).toBeGreaterThan(body.indexOf(split));
expect(lastParagraph(body)).toBe(closing);
});
});