Add unit tests for the virtual campus layout logic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 82/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript, vite
- Domain
- testing
Research direction
Start by reading selectForCampus and normalize in virtual/src/data/activities.ts, then layoutRows in virtual/src/world/kiosks.ts and footprint in virtual/src/world/campus.ts. Check virtual/package.json and the Vite config to see how Vitest would be wired in. Done means npm test runs at least 10 passing tests covering live-first sorting, waitlist ordering, the 40-item hall cap, the study cap of 8, and rotated footprint bounds, and npm run build still passes.
Written by the indexing model from the issue text.
Description
Context
The virtual campus (virtual/, TypeScript + Vite) has no tests and no test script in package.json. The logic that decides what appears in the world is pure and easy to test:
selectForCampus(all, hallCap = 40, studyCap = 8)invirtual/src/data/activities.ts(~line 195): filtering, priority sort, and the 40-item hall budget across groups.normalize()and the slug helper (~line 158) in the same file.layoutRows()invirtual/src/world/kiosks.ts(~line 27) andfootprint()invirtual/src/world/campus.ts(~line 106).
What to do
- Add Vitest as a dev dependency (it reuses the existing Vite config) and add an
npm testscript. - Write tests for the functions above, including: live items sort first, waitlist items appear only after published ones, the hall cap is respected across groups, study groups are capped at 8, and a rotated
footprinthas correct bounds. - Make sure
npm run buildstill passes (tscmust ignore or include test files correctly).
Acceptance criteria
-
npm testpasses invirtual/with at least 10 tests. -
npm run buildstill succeeds. - README documents
npm test.
Files
virtual/package.jsonvirtual/src/data/activities.tsvirtual/src/world/kiosks.tsvirtual/src/world/campus.tsvirtual/src/**/*.test.ts (new)virtual/README.md
Helpful links
Part of GSoC 2027 onboarding — see https://gsoc.alphaonelabs.com
- Dominant language
- HTML
- Stars
- 66
- Forks
- 181
- Avg merge
- 2m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alphaonelabs/website
-
2026-11 documentation good first issue gsoc-2027 project: gsoc
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alphaonelabs/website#1154 · 1 comment ·
Maintainers usually reply within 1 day
-
2026-11 bug good first issue gsoc-2027 project: mockuper
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alphaonelabs/website#1147 · 1 comment ·
Maintainers usually reply within 1 day
-
2026-11 documentation good first issue gsoc-2027 project: botlab
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alphaonelabs/website#1144 · 1 comment ·
Maintainers usually reply within 1 day
-
2026-11 documentation good first issue gsoc-2027 project: pmoss
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
alphaonelabs/website#1139 · 1 comment ·
Maintainers usually reply within 1 day
-
2026-11 bug good first issue gsoc-2027 project: earthmind
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
alphaonelabs/website#1136 · 1 comment ·
Maintainers usually reply within 1 day
All issues in alphaonelabs/website
Similar issues
-
enhancement P3 performance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
thomhurst/TUnit#7380 · 2 comments ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
redhat-developer/rhdh-plugin-export-overlays#4650 · 1 comment ·
Maintainers usually reply within 1 day
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bovinemagnet/AdocFoundry#279 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 1/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day