Jobley / website · jobley.ai / test / volunteer-board.test.mjs
| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { readFileSync } from "node:fs"; |
| 4 | const read = path => readFileSync(new URL(path, import.meta.url), "utf8"); |
| 5 | |
| 6 | test("retired listing and candidate routes point to the volunteer roster", () => { |
| 7 | const redirects = read("../_redirects"); |
| 8 | for (const path of ["/jobs", "/jobs/", "/jobs/*", "/candidates", "/candidates/", "/candidates/*"]) { |
| 9 | assert.ok(redirects.includes(path + " /volunteer/ 301"), path); |
| 10 | } |
| 11 | for (const page of ["index.html", "help/index.html", "compare/index.html", "licenses/index.html", "privacy/index.html", "volunteer/index.html"]) { |
| 12 | const pageSource = read("../" + page); |
| 13 | assert.doesNotMatch(pageSource, /\bpaid\b|salaried|salary|pay range|put yourself forward|\/api\/candidates|\/jobs\//i, page); |
| 14 | } |
| 15 | }); |
| 16 | |
| 17 | test("every volunteer listing is labeled, shareable, and routes to an open trade rather than an application", () => { |
| 18 | const page = read("../volunteer/index.html"); |
| 19 | const roles = [...page.matchAll(/<li class="job" id="([a-z0-9-]+)">/g)].map(match => match[1]); |
| 20 | assert.equal(roles.length, 216); |
| 21 | assert.equal(roles.length, new Set(roles).size); |
| 22 | for (const role of ["program-lead", "glimmer-moderator", "farmers-and-growers", "meal-delivery-driver", "veterinarian", "physician", "robotics-engineer", "local-ai-model-builder"]) { |
| 23 | assert.ok(roles.includes(role), role); |
| 24 | } |
| 25 | assert.equal([...page.matchAll(/Community work in Glimmer · Unpaid/g)].length, roles.length); |
| 26 | assert.equal([...page.matchAll(/href="glimmer:\/\/community\/atom-[a-z0-9-]+" aria-label="Start in Glimmer:/g)].length, roles.length); |
| 27 | assert.match(page, /Every opportunity here is unpaid and optional/); |
| 28 | assert.doesNotMatch(page, /name="resume"|aria-label="Express interest:/); |
| 29 | assert.match(page, /No forms, résumé, or approval is required/); |
| 30 | assert.match(page, /No deliveries or driving shifts are available now/); |
| 31 | assert.doesNotMatch(page, /"@type":"JobPosting"|baseSalary/); |
| 32 | }); |
| 33 | |
| 34 | test("planned chip, data center and AI roles retain unpaid and planning-stage boundaries", () => { |
| 35 | const page = read("../volunteer/index.html"); |
| 36 | const rolesBySection = (id) => { |
| 37 | const match = page.match(new RegExp('<section class="volunteer-section" id="' + id + '">([\\s\\S]*?)</section>')); |
| 38 | assert.ok(match, id); |
| 39 | assert.match(page, new RegExp('href="#' + id + '"')); |
| 40 | return [...match[1].matchAll(/<li class="job" id="([a-z0-9-]+)">/g)].map(role => role[1]); |
| 41 | }; |
| 42 | const chips = rolesBySection("chip-design-and-manufacturing"); |
| 43 | const facilities = rolesBySection("data-centers-power-and-manufacturing"); |
| 44 | const ai = rolesBySection("software-and-ai"); |
| 45 | 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"]) { |
| 46 | assert.ok(chips.includes(name), name); |
| 47 | } |
| 48 | 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"]) { |
| 49 | assert.ok(facilities.includes(name), name); |
| 50 | } |
| 51 | 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"]) { |
| 52 | assert.ok(ai.includes(name), name); |
| 53 | } |
| 54 | assert.match(page, /No fabrication or data center shifts are available now/); |
| 55 | assert.match(page, /Please do not share confidential designs/); |
| 56 | assert.doesNotMatch(page, /nationaliz|government takeover/i); |
| 57 | }); |
| 58 | |
| 59 | test("app support lists all ten apps, offers three volunteer tracks and reuses Glimmer community routes", () => { |
| 60 | const page = read("../volunteer/index.html"); |
| 61 | const section = page.match(/<section class="volunteer-section app-support"[^>]*>[\s\S]*?<\/section>/)[0]; |
| 62 | assert.match(read("../index.html"), /href="\/volunteer\/#app-support"/); |
| 63 | assert.match(section, /unpaid volunteer contributions/); |
| 64 | assert.match(section, /no forms or résumé/); |
| 65 | const cards = [...section.matchAll(/<li class="app-support-card" id="app-support-([a-z]+)">([\s\S]+?)<\/li>/g)]; |
| 66 | const ids = ["opentalon", "inkspring", "jotley", "glimmer", "pulsecanvas", "voxley", "graphley", "bucksley", "jobley", "textley"]; |
| 67 | assert.deepEqual(cards.map(([, id]) => id), ids); |
| 68 | for (const [, id, html] of cards) { |
| 69 | for (const track of [id === "jobley" ? "Web engineering" : "Swift engineering", "QA testing", "Community support"]) assert.ok(html.includes("<dt>" + track + "</dt>")); |
| 70 | assert.match(html, id === "jobley" ? /Website/ : /Apple silicon Mac/); |
| 71 | assert.equal(html.includes("iOS and iPadOS"), !["voxley", "textley", "jobley"].includes(id)); |
| 72 | assert.equal(html.includes('<span class="chip">visionOS</span>'), id === "pulsecanvas"); |
| 73 | assert.match(html, /glimmer:\/\/community\/atom-software/); |
| 74 | assert.match(html, /glimmer:\/\/community\/atom-community/); |
| 75 | assert.ok(html.includes("apps?app=" + id + "#feedback")); |
| 76 | } |
| 77 | assert.doesNotMatch(section, /<form|JobPosting|baseSalary/); |
| 78 | }); |
| 79 | |
| 80 | test("app support cards keep their structure: icon, platform chips, three keyed tracks, three destinations and a jump link", () => { |
| 81 | const page = read("../volunteer/index.html"); |
| 82 | const section = page.match(/<section class="volunteer-section app-support"[^>]*>[\s\S]*?<\/section>/)[0]; |
| 83 | const cards = [...section.matchAll(/<li class="app-support-card" id="app-support-([a-z]+)">([\s\S]+?)<\/li>/g)]; |
| 84 | assert.equal(cards.length, 10); |
| 85 | let ideas = 0; |
| 86 | for (const [, id, html] of cards) { |
| 87 | assert.equal([...html.matchAll(/<h3>[^<]+<\/h3>/g)].length, 1, id); |
| 88 | assert.ok(html.includes(id === "jobley" ? 'src="/assets/icon.png' : 'src="/app-icons/' + id + '.webp"'), id); |
| 89 | assert.equal([...html.matchAll(/<span class="chip">/g)].length, ["voxley", "textley", "jobley"].includes(id) ? 1 : id === "pulsecanvas" ? 3 : 2, id); |
| 90 | for (const track of ["swift", "qa", "community"]) { |
| 91 | assert.equal([...html.matchAll(new RegExp('<div class="app-track app-track-' + track + '"><dt>[^<]+</dt><dd>[^<]{20,}</dd></div>', "g"))].length, 1, id + " " + track); |
| 92 | ideas += 1; |
| 93 | } |
| 94 | assert.equal([...html.matchAll(/<a href="(?:glimmer:\/\/community\/atom-[a-z0-9-]+|https:\/\/projectatom\.ai\/apps\?app=[a-z]+#feedback)" aria-label="[^"]+"><span>[^<]+<\/span><span class="app-action-meta" aria-hidden="true">/g)].length, 3, id); |
| 95 | assert.doesNotMatch(html, /\.dmg|\/downloads\/|testflight|apps\.apple\.com/i, id); |
| 96 | assert.ok(section.includes('<li><a href="#app-support-' + id + '">'), id); |
| 97 | } |
| 98 | assert.equal(ideas, 30); |
| 99 | }); |
| 100 | |
| 101 | test("the volunteer and career pages load one scoped, versioned stylesheet and link to each other", () => { |
| 102 | const css = read("../assets/volunteer.css"); |
| 103 | const link = /<link rel="stylesheet" href="\/assets\/volunteer\.css\?v=(\d{8}[a-z])">/; |
| 104 | const volunteer = read("../volunteer/index.html"), careers = read("../careers/index.html"); |
| 105 | const version = volunteer.match(link)?.[1]; |
| 106 | assert.ok(version, "volunteer page links volunteer.css with a version"); |
| 107 | assert.equal(careers.match(link)?.[1], version); |
| 108 | assert.ok(read("../tools/build-site.py").includes('VOLUNTEER_CSS_V = "' + version + '"')); |
| 109 | for (const page of [volunteer, careers]) { |
| 110 | assert.ok(page.indexOf('href="/assets/site.css"') < page.indexOf("/assets/volunteer.css"), "scoped rules load after the shared stylesheet"); |
| 111 | assert.match(page, /<nav class="volunteer-switch" aria-label="Volunteer directories"><a href="\/volunteer\/"[^>]*><strong>Volunteer roster<\/strong><span>216 roles and 10 projects<\/span><\/a><a href="\/careers\/"[^>]*><strong>Ideas by career<\/strong><span>848 titles in 22 families<\/span><\/a><\/nav>/); |
| 112 | assert.equal([...page.matchAll(/<nav class="volunteer-switch"[\s\S]*?<\/nav>/g)][0][0].match(/aria-current="page"/g).length, 1); |
| 113 | } |
| 114 | for (const other of ["index.html", "help/index.html", "compare/index.html", "moderators/index.html", "privacy/index.html", "licenses/index.html", "404.html"]) { |
| 115 | assert.doesNotMatch(read("../" + other), /volunteer\.css/, other); |
| 116 | } |
| 117 | for (const selector of [".volunteer-section", ".volunteer-switch", ".workstreams", ".app-support-head", ".app-support-index", ".app-support-grid", ".app-support-card", ".app-card-head", ".app-support-platforms .chip", ".app-track-swift", ".app-track-qa", ".app-track-community", ".app-support-note", ".app-support-actions a", ".app-action-meta", ".career-families", ".career-filters"]) { |
| 118 | assert.ok(css.includes(selector), selector); |
| 119 | } |
| 120 | assert.doesNotMatch(css, /url\(|@import|https?:/, "the scoped stylesheet stays self-contained"); |
| 121 | }); |
| 122 | |
| 123 | test("public pages point to Glimmer without promoting a Jobley native release", () => { |
| 124 | for (const name of ["index.html", "volunteer/index.html", "careers/index.html", "help/index.html", "compare/index.html", "moderators/index.html", "privacy/index.html", "licenses/index.html", "404.html", "sitemap.xml"]) { |
| 125 | const page = read("../" + name); |
| 126 | if (name.endsWith("html")) assert.match(page, /href="https:\/\/glimmertoday\.ai\/download"/, name); |
| 127 | assert.doesNotMatch(page, /\.dmg|\/downloads\/|testflight|apps\.apple\.com|jobley\.ai\/(download|mcp)\/|href="\/(download|mcp)\/|"SoftwareApplication"|downloadUrl|installUrl/i, name); |
| 128 | } |
| 129 | const jobley = read("../volunteer/index.html").split('id="app-support-jobley"')[1].split('</li>')[0]; |
| 130 | assert.match(jobley, /class="chip">Website/); |
| 131 | assert.match(jobley, /Web engineering/); |
| 132 | assert.doesNotMatch(jobley, /Apple silicon|iPhone|iPad|Swift engineering/); |
| 133 | }); |
| 134 | |
| 135 | test("all volunteer roles publish a distinct learning exercise and retain their Glimmer route", () => { |
| 136 | const page = read("../volunteer/index.html"); |
| 137 | const paths = [...page.matchAll(/<li class="job" id="([a-z0-9-]+)">[\s\S]*?<details class="volunteer-learning"><summary>Getting started and learning path<\/summary><ol>\s*<li>([^<]+)<\/li>\s*<li><a href="\/volunteer\/learn\/[a-z0-9-]+\/">[\s\S]*?<\/details>\s*<div class="job-actions"><a[^>]+href="glimmer:\/\/community\/atom-[a-z0-9-]+"/g)]; |
| 138 | assert.equal(paths.length, 216); |
| 139 | assert.equal(new Set(paths.map(path => path[2])).size, paths.length); |
| 140 | const ids = [...page.matchAll(/\sid="([^"]+)"/g)].map(match => match[1]); |
| 141 | assert.equal(new Set(ids).size, ids.length); |
| 142 | for (const [, hash] of page.matchAll(/href="#([a-z0-9-]+)"/g)) assert.ok(ids.includes(hash), hash); |
| 143 | }); |
| 144 | |
| 145 | test("formal trade pathways distinguish free peer training from external credentials", () => { |
| 146 | const page = read("../volunteer/index.html"); |
| 147 | const section = page.match(/<section class="volunteer-section trade-training"[\s\S]*?<\/section>/)[0]; |
| 148 | for (const id of ["electrical-training", "plumbing-training", "hvac-training"]) assert.ok(section.includes('id="' + id + '"')); |
| 149 | assert.match(section, /free introductory learning in Glimmer/); |
| 150 | assert.match(section, /not accredited training/); |
| 151 | assert.match(section, /whether or not you contribute in Glimmer/); |
| 152 | assert.match(section, /exam fees/); |
| 153 | assert.match(section, /apprenticeship\.gov/); |
| 154 | assert.match(section, /epa\.gov\/section608/); |
| 155 | assert.match(section, /glimmer:\/\/community\/atom-data-centers-trades/); |
| 156 | }); |
| 157 | |
| 158 | test("getting started offers download first and a separate no-install browse path", () => { |
| 159 | for (const [file, browseHref] of [["index.html", "/volunteer/"], ["volunteer/index.html", "#volunteer-board"]]) { |
| 160 | const page = read("../" + file); |
| 161 | const onboarding = page.split('id="getting-started"')[1].split("</section>")[0]; |
| 162 | const choices = [...onboarding.matchAll(/<a[^>]+href="([^"]+)">([^<]+)/g)]; |
| 163 | assert.deepEqual(choices.map(([, href, label]) => [href, label.trim()]), [ |
| 164 | ["https://glimmertoday.ai/download", "Download Glimmer"], |
| 165 | [browseHref, "Browse volunteer work"], |
| 166 | ]); |
| 167 | assert.match(onboarding, /Already have Glimmer\?/); |
| 168 | assert.match(onboarding, /You can browse without the app\./); |
| 169 | if (browseHref.startsWith("#")) assert.ok(page.includes('id="' + browseHref.slice(1) + '"')); |
| 170 | } |
| 171 | }); |
| 172 | |
| 173 | test("IP attorney roles have independent starter guides and open Leadership and operations in Glimmer", () => { |
| 174 | const page = read("../volunteer/index.html"); |
| 175 | const roles = ["trademark-attorney", "copyright-and-media-licensing-attorney", "open-source-and-software-ip-attorney"]; |
| 176 | for (const slug of roles) { |
| 177 | const [, listing] = page.split('<li class="job" id="' + slug + '">'); |
| 178 | assert.ok(listing, slug); |
| 179 | const card = listing.split('<li class="job"')[0]; |
| 180 | assert.ok(card.includes('/volunteer/learn/' + slug + '/'), slug); |
| 181 | assert.match(card, /href="glimmer:\/\/community\/atom-leadership-operations"/); |
| 182 | assert.match(card, /Community work in Glimmer · Unpaid/); |
| 183 | } |
| 184 | }); |
| 185 | |
| 186 | test("new research categories are volunteer-only and link to their Glimmer groups", () => { |
| 187 | const page = read("../volunteer/index.html"); |
| 188 | for (const slug of ["baby-products","sell-your-home-by-owner","online-banking-research","clean-waterways","mosquito-control-research"]) { |
| 189 | const mark = 'href="glimmer://community/atom-' + slug + '" aria-label="Start in Glimmer:'; |
| 190 | assert.equal(page.split(mark).length - 1, 4, slug); |
| 191 | } |
| 192 | assert.doesNotMatch(page, /Medicine access research volunteer/); |
| 193 | assert.match(page, /No bank is open/); |
| 194 | assert.match(page, /No product is available and no children participate/); |
| 195 | }); |
| 196 | |
| 197 | test("project workstreams have exact role and group anchors, guides, and Glimmer destinations", () => { |
| 198 | const page = read("../volunteer/index.html"); |
| 199 | const workstreams = [ |
| 200 | ["14-inch-laptop", "14-inch-laptop-repairability-researcher", "atom-build-14-inch-laptop", "ftc.gov"], |
| 201 | ["linux-desktop-computers", "linux-desktop-accessibility-and-qa", "atom-build-linux-desktop", "gnome.org"], |
| 202 | ["dual-screen-foldable-phone", "dual-screen-foldable-interaction-designer", "atom-build-flip-phone", "developer.android.com"], |
| 203 | ["open-home-hardware", "open-home-hardware-repairability-researcher", "atom-open-home-hardware", "ftc.gov"], |
| 204 | ["nuclear-disarmament", "nuclear-disarmament-policy-researcher", "atom-nuclear-disarmament", "un.org"], |
| 205 | ["uncrewed-submersible-safety", "uncrewed-submersible-safety-reviewer", "atom-submersible-safety", "ntsb.gov"], |
| 206 | ["menopause-evidence", "menopause-evidence-reviewer", "atom-menopause-research", "womenshealth.gov"], |
| 207 | ["adoption-and-fostering", "animal-adoption-and-foster-support", "atom-health-veterinary", "aspca.org"], |
| 208 | ]; |
| 209 | for (const [group, role, trade, source] of workstreams) { |
| 210 | const section = page.split('<section class="volunteer-section" id="' + group + '">')[1]?.split("</section>")[0]; |
| 211 | assert.ok(section, group); |
| 212 | assert.ok(section.includes('id="' + role + '"'), role); |
| 213 | assert.ok(section.includes('href="glimmer://community/' + trade + '"'), role); |
| 214 | assert.ok(section.includes('/assets/role-art/volunteer/' + role + '.svg'), role); |
| 215 | assert.ok(section.includes('/volunteer/learn/' + role + '/'), role); |
| 216 | assert.doesNotMatch(section, /<form|Apply now|JobPosting/); |
| 217 | const guide = read('../volunteer/learn/' + role + '/index.html'); |
| 218 | assert.ok(guide.includes('href="/volunteer/#' + role + '"'), role); |
| 219 | assert.ok(guide.includes('href="glimmer://community/' + trade + '"'), role); |
| 220 | assert.ok(guide.includes(source), role); |
| 221 | assert.match(guide, /Scope and next steps/); |
| 222 | } |
| 223 | assert.match(page, /book-style phone concept with two full-size screens/); |
| 224 | assert.match(page, /Never use a private foster-home address/); |
| 225 | assert.match(page, /This is not a live listing or intake service/); |
| 226 | assert.doesNotMatch(page, /Volunteer with (?:<em>)?Project ATOM|Volunteer with our apps/); |
| 227 | }); |
| 228 | |
| 229 | test('Open Source Browser project has four role links that open its specific Glimmer group', () => { |
| 230 | const page = readFileSync('volunteer/index.html', 'utf8'); |
| 231 | assert.match(page, /id="open-source-browser"/); |
| 232 | for (const role of ['browser-platform-engineer', 'browser-privacy-and-update-engineer', 'browser-accessibility-designer', 'browser-quality-assurance-contributor']) { |
| 233 | assert.match(page, new RegExp('id="' + role + '"')); |
| 234 | } |
| 235 | assert.equal((page.match(/glimmer:\/\/community\/atom-open-browser/g) || []).length >= 4, true); |
| 236 | }); |