import test from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; const read = path => readFileSync(new URL(path, import.meta.url), "utf8"); test("retired listing and candidate routes point to the volunteer roster", () => { const redirects = read("../_redirects"); for (const path of ["/jobs", "/jobs/", "/jobs/*", "/candidates", "/candidates/", "/candidates/*"]) { assert.ok(redirects.includes(path + " /volunteer/ 301"), path); } for (const page of ["index.html", "help/index.html", "compare/index.html", "licenses/index.html", "privacy/index.html", "volunteer/index.html"]) { const pageSource = read("../" + page); assert.doesNotMatch(pageSource, /\bpaid\b|salaried|salary|pay range|put yourself forward|\/api\/candidates|\/jobs\//i, page); } }); test("every volunteer listing is labeled, shareable, and routes to an open trade rather than an application", () => { const page = read("../volunteer/index.html"); const roles = [...page.matchAll(/
  • /g)].map(match => match[1]); assert.equal(roles.length, 216); assert.equal(roles.length, new Set(roles).size); for (const role of ["program-lead", "glimmer-moderator", "farmers-and-growers", "meal-delivery-driver", "veterinarian", "physician", "robotics-engineer", "local-ai-model-builder"]) { assert.ok(roles.includes(role), role); } assert.equal([...page.matchAll(/Community work in Glimmer · Unpaid/g)].length, roles.length); assert.equal([...page.matchAll(/href="glimmer:\/\/community\/atom-[a-z0-9-]+" aria-label="Start in Glimmer:/g)].length, roles.length); assert.match(page, /Every opportunity here is unpaid and optional/); assert.doesNotMatch(page, /name="resume"|aria-label="Express interest:/); assert.match(page, /No forms, résumé, or approval is required/); assert.match(page, /No deliveries or driving shifts are available now/); assert.doesNotMatch(page, /"@type":"JobPosting"|baseSalary/); }); test("planned chip, data center and AI roles retain unpaid and planning-stage boundaries", () => { const page = read("../volunteer/index.html"); const rolesBySection = (id) => { const match = page.match(new RegExp('
    ([\\s\\S]*?)
    ')); assert.ok(match, id); assert.match(page, new RegExp('href="#' + id + '"')); return [...match[1].matchAll(/
  • /g)].map(role => role[1]); }; const chips = rolesBySection("chip-design-and-manufacturing"); const facilities = rolesBySection("data-centers-power-and-manufacturing"); const ai = rolesBySection("software-and-ai"); for (const name of ["processor-architecture-volunteer", "memory-chip-design-volunteer", "computer-board-design-volunteer", "storage-systems-volunteer", "firmware-and-drivers-volunteer", "semiconductor-architecture-volunteer", "semiconductor-equipment-technician", "semiconductor-test-and-quality-volunteer", "semiconductor-procurement-volunteer", "semiconductor-materials-and-logistics-volunteer", "cleanroom-facilities-and-trades-adviser", "semiconductor-health-safety-and-environment-volunteer", "manufacturing-documentation-and-training-volunteer"]) { assert.ok(chips.includes(name), name); } for (const name of ["worldwide-data-center-site-planner", "data-center-hardware-and-rack-technician", "data-center-field-trades-adviser", "data-center-commissioning-and-quality-volunteer", "data-center-site-safety-volunteer"]) { assert.ok(facilities.includes(name), name); } for (const name of ["ai-training-infrastructure-engineer", "ai-inference-and-serving-engineer", "ai-data-curation-volunteer", "ai-evaluation-and-qa-volunteer", "ai-model-documentation-volunteer"]) { assert.ok(ai.includes(name), name); } assert.match(page, /No fabrication or data center shifts are available now/); assert.match(page, /Please do not share confidential designs/); assert.doesNotMatch(page, /nationaliz|government takeover/i); }); test("app support lists all ten apps, offers three volunteer tracks and reuses Glimmer community routes", () => { const page = read("../volunteer/index.html"); const section = page.match(/
    ]*>[\s\S]*?<\/section>/)[0]; assert.match(read("../index.html"), /href="\/volunteer\/#app-support"/); assert.match(section, /unpaid volunteer contributions/); assert.match(section, /no forms or résumé/); const cards = [...section.matchAll(/
  • ([\s\S]+?)<\/li>/g)]; const ids = ["opentalon", "inkspring", "jotley", "glimmer", "pulsecanvas", "voxley", "graphley", "bucksley", "jobley", "textley"]; assert.deepEqual(cards.map(([, id]) => id), ids); for (const [, id, html] of cards) { for (const track of [id === "jobley" ? "Web engineering" : "Swift engineering", "QA testing", "Community support"]) assert.ok(html.includes("
    " + track + "
    ")); assert.match(html, id === "jobley" ? /Website/ : /Apple silicon Mac/); assert.equal(html.includes("iOS and iPadOS"), !["voxley", "textley", "jobley"].includes(id)); assert.equal(html.includes('visionOS'), id === "pulsecanvas"); assert.match(html, /glimmer:\/\/community\/atom-software/); assert.match(html, /glimmer:\/\/community\/atom-community/); assert.ok(html.includes("apps?app=" + id + "#feedback")); } assert.doesNotMatch(section, / { const page = read("../volunteer/index.html"); const section = page.match(/
    ]*>[\s\S]*?<\/section>/)[0]; const cards = [...section.matchAll(/
  • ([\s\S]+?)<\/li>/g)]; assert.equal(cards.length, 10); let ideas = 0; for (const [, id, html] of cards) { assert.equal([...html.matchAll(/

    [^<]+<\/h3>/g)].length, 1, id); assert.ok(html.includes(id === "jobley" ? 'src="/assets/icon.png' : 'src="/app-icons/' + id + '.webp"'), id); assert.equal([...html.matchAll(//g)].length, ["voxley", "textley", "jobley"].includes(id) ? 1 : id === "pulsecanvas" ? 3 : 2, id); for (const track of ["swift", "qa", "community"]) { assert.equal([...html.matchAll(new RegExp('
    [^<]+
    [^<]{20,}
    ', "g"))].length, 1, id + " " + track); ideas += 1; } assert.equal([...html.matchAll(/[^<]+<\/span>
  • '), id); } assert.equal(ideas, 30); }); test("the volunteer and career pages load one scoped, versioned stylesheet and link to each other", () => { const css = read("../assets/volunteer.css"); const link = //; const volunteer = read("../volunteer/index.html"), careers = read("../careers/index.html"); const version = volunteer.match(link)?.[1]; assert.ok(version, "volunteer page links volunteer.css with a version"); assert.equal(careers.match(link)?.[1], version); assert.ok(read("../tools/build-site.py").includes('VOLUNTEER_CSS_V = "' + version + '"')); for (const page of [volunteer, careers]) { assert.ok(page.indexOf('href="/assets/site.css"') < page.indexOf("/assets/volunteer.css"), "scoped rules load after the shared stylesheet"); assert.match(page, /
  • ')[0]; assert.match(jobley, /class="chip">Website/); assert.match(jobley, /Web engineering/); assert.doesNotMatch(jobley, /Apple silicon|iPhone|iPad|Swift engineering/); }); test("all volunteer roles publish a distinct learning exercise and retain their Glimmer route", () => { const page = read("../volunteer/index.html"); const paths = [...page.matchAll(/
  • [\s\S]*?
    Getting started and learning path<\/summary>
      \s*
    1. ([^<]+)<\/li>\s*
    2. [\s\S]*?<\/details>\s*
      ]+href="glimmer:\/\/community\/atom-[a-z0-9-]+"/g)]; assert.equal(paths.length, 216); assert.equal(new Set(paths.map(path => path[2])).size, paths.length); const ids = [...page.matchAll(/\sid="([^"]+)"/g)].map(match => match[1]); assert.equal(new Set(ids).size, ids.length); for (const [, hash] of page.matchAll(/href="#([a-z0-9-]+)"/g)) assert.ok(ids.includes(hash), hash); }); test("formal trade pathways distinguish free peer training from external credentials", () => { const page = read("../volunteer/index.html"); const section = page.match(/
      /)[0]; for (const id of ["electrical-training", "plumbing-training", "hvac-training"]) assert.ok(section.includes('id="' + id + '"')); assert.match(section, /free introductory learning in Glimmer/); assert.match(section, /not accredited training/); assert.match(section, /whether or not you contribute in Glimmer/); assert.match(section, /exam fees/); assert.match(section, /apprenticeship\.gov/); assert.match(section, /epa\.gov\/section608/); assert.match(section, /glimmer:\/\/community\/atom-data-centers-trades/); }); test("getting started offers download first and a separate no-install browse path", () => { for (const [file, browseHref] of [["index.html", "/volunteer/"], ["volunteer/index.html", "#volunteer-board"]]) { const page = read("../" + file); const onboarding = page.split('id="getting-started"')[1].split("
      ")[0]; const choices = [...onboarding.matchAll(/]+href="([^"]+)">([^<]+)/g)]; assert.deepEqual(choices.map(([, href, label]) => [href, label.trim()]), [ ["https://glimmertoday.ai/download", "Download Glimmer"], [browseHref, "Browse volunteer work"], ]); assert.match(onboarding, /Already have Glimmer\?/); assert.match(onboarding, /You can browse without the app\./); if (browseHref.startsWith("#")) assert.ok(page.includes('id="' + browseHref.slice(1) + '"')); } }); test("IP attorney roles have independent starter guides and open Leadership and operations in Glimmer", () => { const page = read("../volunteer/index.html"); const roles = ["trademark-attorney", "copyright-and-media-licensing-attorney", "open-source-and-software-ip-attorney"]; for (const slug of roles) { const [, listing] = page.split('
    3. '); assert.ok(listing, slug); const card = listing.split('
    4. { const page = read("../volunteer/index.html"); for (const slug of ["baby-products","sell-your-home-by-owner","online-banking-research","clean-waterways","mosquito-control-research"]) { const mark = 'href="glimmer://community/atom-' + slug + '" aria-label="Start in Glimmer:'; assert.equal(page.split(mark).length - 1, 4, slug); } assert.doesNotMatch(page, /Medicine access research volunteer/); assert.match(page, /No bank is open/); assert.match(page, /No product is available and no children participate/); }); test("project workstreams have exact role and group anchors, guides, and Glimmer destinations", () => { const page = read("../volunteer/index.html"); const workstreams = [ ["14-inch-laptop", "14-inch-laptop-repairability-researcher", "atom-build-14-inch-laptop", "ftc.gov"], ["linux-desktop-computers", "linux-desktop-accessibility-and-qa", "atom-build-linux-desktop", "gnome.org"], ["dual-screen-foldable-phone", "dual-screen-foldable-interaction-designer", "atom-build-flip-phone", "developer.android.com"], ["open-home-hardware", "open-home-hardware-repairability-researcher", "atom-open-home-hardware", "ftc.gov"], ["nuclear-disarmament", "nuclear-disarmament-policy-researcher", "atom-nuclear-disarmament", "un.org"], ["uncrewed-submersible-safety", "uncrewed-submersible-safety-reviewer", "atom-submersible-safety", "ntsb.gov"], ["menopause-evidence", "menopause-evidence-reviewer", "atom-menopause-research", "womenshealth.gov"], ["adoption-and-fostering", "animal-adoption-and-foster-support", "atom-health-veterinary", "aspca.org"], ]; for (const [group, role, trade, source] of workstreams) { const section = page.split('
      ')[1]?.split("
      ")[0]; assert.ok(section, group); assert.ok(section.includes('id="' + role + '"'), role); assert.ok(section.includes('href="glimmer://community/' + trade + '"'), role); assert.ok(section.includes('/assets/role-art/volunteer/' + role + '.svg'), role); assert.ok(section.includes('/volunteer/learn/' + role + '/'), role); assert.doesNotMatch(section, /)?Project ATOM|Volunteer with our apps/); }); test('Open Source Browser project has four role links that open its specific Glimmer group', () => { const page = readFileSync('volunteer/index.html', 'utf8'); assert.match(page, /id="open-source-browser"/); for (const role of ['browser-platform-engineer', 'browser-privacy-and-update-engineer', 'browser-accessibility-designer', 'browser-quality-assurance-contributor']) { assert.match(page, new RegExp('id="' + role + '"')); } assert.equal((page.match(/glimmer:\/\/community\/atom-open-browser/g) || []).length >= 4, true); });