Skip to content

Cleanup test infra - #52

Merged
robz merged 3 commits into
asmbly-makerspace:mainfrom
robz:cleanup-test-infra
Jun 14, 2026
Merged

Cleanup test infra#52
robz merged 3 commits into
asmbly-makerspace:mainfrom
robz:cleanup-test-infra

Conversation

@robz

@robz robz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

move e2e and unit tests into app, update readme, fix lockfile so CI should work now, update dev db

testplan

unit and e2e tests pass, also verify page loads locally:

app % npm run test:e2e

> app@0.0.1 test:e2e
> playwright test

[WebServer] [baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`

Running 7 tests using 3 workers

  ✓  1 [chromium] › tests/e2e/images.spec.js:112:1 › required fallback class images exist (2ms)
  ✓  2 [chromium] › tests/e2e/images.spec.js:118:1 › new class image filenames do not look like generated duplicate variants (21ms)
  ✓  3 [chromium] › tests/e2e/class-list.spec.js:27:2 › class list page › renders correctly (6.7s)
[WebServer] Browserslist: browsers data (caniuse-lite) is 8 months old. Please run:
[WebServer]   npx update-browserslist-db@latest
[WebServer]   Why you should do it regularly: https://github.com/browserslist/update-db#readme
  ✓  4 [chromium] › tests/e2e/class-list.spec.js:78:2 › class list page › search works (5.9s)
  ✓  5 [chromium] › tests/e2e/class-list.spec.js:108:2 › class list page › sort works (5.5s)
  ✓  6 [chromium] › tests/e2e/class-list.spec.js:136:2 › class list page › filters work (5.8s)
  ✓  7 [chromium] › tests/e2e/class-list.spec.js:163:2 › class list page › navigation works (6.5s)

  7 passed (31.8s)
app % npm test        

> app@0.0.1 test
> vitest --run

[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`

 RUN  v2.1.9 asmbly-classes/app

stdout | src/routes/newsletter-signup/page.server.test.js > POST /newsletter-signup > successfully signs up newsletter subscriber
POST { valid: true, data: { email: 'test@example.com' } }

stdout | src/routes/newsletter-signup/page.server.test.js > POST /newsletter-signup > sends correct authorization header with API key
POST { valid: true, data: { email: 'test@example.com' } }

stdout | src/routes/newsletter-signup/page.server.test.js > POST /newsletter-signup > handles different email formats
POST { valid: true, data: { email: 'user@example.com' } }
POST { valid: true, data: { email: 'user+tag@example.com' } }
POST { valid: true, data: { email: 'user.name@subdomain.example.com' } }

stdout | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > decrements attendee count on cancellation
Event registration canceled with status CANCELED: Event ID: 123 - Neon ID: 456
Decrementing seat count for Test Class on Mar 1, 2026, 4:00 AM

stdout | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > does not decrement if user already canceled
Event registration canceled with status CANCELED: Event ID: 123 - Neon ID: 456
Registrant (Neon ID: 456) has already cancelled. Will not decrement.

stdout | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > sends notification emails to waitlist when seat opens
Event registration canceled with status CANCELED: Event ID: 123 - Neon ID: 456
Decrementing seat count for Advanced Woodworking on Mar 15, 2026, 9:00 AM
Sending waitlist seat opening email to waitlist1@example.com for Advanced Woodworking on Sun, Mar 15, 2026
Sending waitlist seat opening email to waitlist2@example.com for Advanced Woodworking on Sun, Mar 15, 2026

stdout | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > handles refunded status same as canceled
Event registration canceled with status REFUNDED: Event ID: 123 - Neon ID: 456
Decrementing seat count for Test Class on Mar 1, 2026, 4:00 AM

stdout | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > continues even if some emails fail
Event registration canceled with status CANCELED: Event ID: 123 - Neon ID: 456
Decrementing seat count for Test Class on Mar 15, 2026, 9:00 AM
Sending waitlist seat opening email to good@example.com for Test Class on Sun, Mar 15, 2026
Sending waitlist seat opening email to bad@example.com for Test Class on Sun, Mar 15, 2026

stderr | src/routes/api/class-cancellation/server.test.js > POST /api/class-cancellation > continues even if some emails fail
Error sending email: Error: Email failed

stdout | src/routes/api/class-registration/server.test.js > POST /api/class-registration > increments attendee count on successful registration
Event Registration: Event ID: 123 - Neon ID: 456
Incremented attendee count for Test Class on Mar 1, 2026, 4:00 AM

stdout | src/routes/api/class-registration/server.test.js > POST /api/class-registration > fulfills request when registrant is on the waitlist
Event Registration: Event ID: 123 - Neon ID: 456
Incremented attendee count for Test Class on Mar 1, 2026, 4:00 AM

stdout | src/routes/api/class-registration/server.test.js > POST /api/class-registration > does not fulfill request when registrant email does not match
Event Registration: Event ID: 123 - Neon ID: 456
Incremented attendee count for Test Class on Mar 1, 2026, 4:00 AM

 ✓ src/index.test.js (1)
 ✓ src/routes/newsletter-signup/page.server.test.js (5)
 ✓ src/lib/models/neonEventInstance.test.js (27)
 ✓ src/lib/models/neonEventType.test.js (28)
 ✓ src/lib/server/auth.test.js (21)
 ✓ src/lib/helpers/neonHelpers.test.js (15)
 ✓ src/routes/api/class-cancellation/server.test.js (8)
 ✓ src/routes/api/class-registration/server.test.js (6)
 ✓ src/routes/(data-pages)/event/[eventTypeId]/page.server.test.js (16)

 Test Files  9 passed (9)
      Tests  127 passed (127)
   Start at  12:00:55
   Duration  326ms (transform 225ms, setup 0ms, collect 563ms, tests 195ms, environment 1ms, prepare 379ms)

app % cd ../dev
dev % ./load-dev-db.sh
==> Removing existing container...
==> Starting Postgres...
==> Waiting for Postgres to be ready...
==> Loading dev database...
==> Installing dependencies...

up to date, audited 369 packages in 2s

85 packages are looking for funding
  run `npm fund` for details

23 vulnerabilities (1 low, 11 moderate, 9 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
==> Starting dev server at http://localhost:5173...

> app@0.0.1 dev
> vite dev

[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`

  VITE v5.4.21  ready in 281 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help

@robz
robz merged commit de83298 into asmbly-makerspace:main Jun 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant