← back to Stars of Design
smoke: 9 new checks for /api/{designers,firms,clients}/random + /random/{designer,firm,client}
4edf44d4d12410a9a8d7b38d819bc3a08bab9a3a · 2026-05-13 09:35:54 -0700 · Steve Abrams
Files touched
M routes/public.jsM test/smoke.js
Diff
commit 4edf44d4d12410a9a8d7b38d819bc3a08bab9a3a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed May 13 09:35:54 2026 -0700
smoke: 9 new checks for /api/{designers,firms,clients}/random + /random/{designer,firm,client}
---
routes/public.js | 3 +++
test/smoke.js | 11 +++++++++++
2 files changed, 14 insertions(+)
diff --git a/routes/public.js b/routes/public.js
index 5449ebd..602ab2c 100644
--- a/routes/public.js
+++ b/routes/public.js
@@ -404,6 +404,9 @@ router.get('/api', (_req, res) => {
'GET /api/designers/random': 'Random designer — JSON {slug, display_name}',
'GET /api/firms/random': 'Random firm — JSON {slug, name}',
'GET /api/clients/random': 'Random DW client — JSON {slug, name}',
+ 'GET /random/designer': '302 redirect to a random designer detail page',
+ 'GET /random/firm': '302 redirect to a random firm detail page',
+ 'GET /random/client': '302 redirect to a random DW client detail page',
},
notes: [
'Profiles are city + state only; no street addresses, no phone numbers (PII policy).',
diff --git a/test/smoke.js b/test/smoke.js
index f9279d1..7bf0ac4 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -109,6 +109,17 @@ function check(name, cond, hint = '') {
check('api/stats: 200', r.status === 200);
check('api/stats: designers field', /"designers":/.test(r.body));
+ // 8c. /api/{designers,firms,clients}/random + /random/{designer,firm,client}
+ for (const k of ['designers', 'firms', 'clients']) {
+ r = await fetch(`/api/${k}/random`);
+ check(`api/${k}/random: 200`, r.status === 200);
+ check(`api/${k}/random: slug`, /"slug":"[a-z0-9-]+/.test(r.body));
+ }
+ for (const k of ['designer', 'firm', 'client']) {
+ r = await fetch(`/random/${k}`, { redirect: 'manual' });
+ check(`/random/${k}: 302`, r.status === 302);
+ }
+
// 9. /sitemap.xml + /robots.txt + /favicon.ico
r = await fetch('/sitemap.xml');
check('sitemap: 200', r.status === 200);
← da27142 API: add /random/designer + /random/firm + /random/client re
·
back to Stars of Design
·
sitemap.txt: emit Last-Modified header for conditional GET ( ce39c6b →