Skip to content

Add unit tests for the upload/date helpers and a CI workflow - #19

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785282044-lib-unit-tests
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785282044-lib-unit-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The pure helpers behind the two riskiest admin paths — parsing an uploaded attendee/code spreadsheet (lib/spreadsheet.ts) and rendering event countdowns (lib/event-date.ts) — had no coverage, so a regression there only shows up as "the upload silently dropped a row". This adds Vitest plus tests that pin the behavior those functions already have, and wires lint + typecheck + tests into GitHub Actions on every PR.

Coverage pins the edge cases that are easy to break in a refactor:

  • parseCsv: quoted fields, "" escapes, CRLF, blank-row filtering
  • extractEmails: email found in any column, Name <a@b.co> cells, lowercasing, dedupe
  • extractCodes: header-named column vs. headerless single-column files (every row is data), trim/dedupe
  • event-date: daysUntilEvent ignores time-of-day on both sides, eventCountdownLabel → Today / Tomorrow / In N days / null when past

npm test runs vitest run; no test env config is needed since these are all node-side pure functions.

Link to Devin session: https://app.devin.ai/sessions/a325715ce3164734964a55f90b84eed7
Requested by: @dabit3


Open in Devin Review

Co-Authored-By: Nader Dabit <dabit3@gmail.com>
@dabit3 dabit3 self-assigned this Jul 28, 2026
@dabit3
dabit3 self-requested a review July 28, 2026 23:40
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vending-machine Ready Ready Preview, Comment Jul 28, 2026 11:41pm

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@dabit3 dabit3 closed this Jul 28, 2026

This branch was successfully deployed

1 active deployment
Preview — 0d9f8781 Deployed Jul 28, 2026 by vercel[bot]
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