Branchwell

Jobley / website · jobley.ai / test / volunteer-board.test.mjs

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