Skip to content

Show the exam centre validity pill in the pin popup - #326

Merged
AnayDhawan merged 1 commit into
StudentSuite:mainfrom
propcgamer20-png:feat/exam-centre-countdown
Oct 30, 2026
Merged

AnayDhawan merged 1 commit into
StudentSuite:mainfrom
propcgamer20-png:feat/exam-centre-countdown

Conversation

@propcgamer20-png

Copy link
Copy Markdown
Member

What this changes

Part of #313, one item from its checklist: ExamCentreCountdown (src/components/pins/exam-centre-countdown.tsx) was written but not used anywhere. This renders it in the pin popup, next to VerifiedBadge, as the issue suggests. The other items are untouched, so this does not use "Fixes".

  • src/components/pins/pin-popup.tsx: the header row now includes <ExamCentreCountdown place={place} />. It renders nothing for places without valid_till, so only SAT and foreign-language exam centres get a pill. The "reconfirm by " text in the exam note below the address is removed, because the pill now carries the same date, and the unused local formatValidTill is deleted with it.
  • src/components/pins/exam-centre-countdown.tsx: new optional now prop (defaults to the current time), the same pattern VerifiedBadge uses, so the date logic can be tested.
  • src/components/pins/exam-centre-countdown.test.tsx (new): 7 tests. Far-off date is green "Valid until ...", inside 60 days is amber "Expires soon", the day after the reference date still counts, a past date is red "Expired ...", no valid_till renders nothing, and the popup shows the pill (and no longer the "reconfirm by" text) for an exam centre but no pill for a library.

Note for review

The pill says "Valid until " while the data field and the old popup text call the date a "reconfirm by" date (data/CONTRIBUTING.md). I kept the component's own wording rather than change its design; if "Reconfirm by" reads better for students, that is a one-word change in the component.

Proof

npm run lint, npm run typecheck, npm run format:check clean. npm run test:unit for the pins folder: 11 passed. I did not look at it in a browser.

Type of change

  • Code or fix
  • New public place(s)
  • New or updated benefit guide
  • New or updated resource link
  • Docs

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@propcgamer20-png is attempting to deploy a commit to the studentsuite Team on Vercel.

A member of the Team first needs to authorize it.

@AnayDhawan
AnayDhawan merged commit 7e42d17 into StudentSuite:main Oct 30, 2026
4 of 5 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.

2 participants