Loading
Convert CurrentYearTable to TypeScript
Part of &33. Closes #868 (closed).
Scope
contributors/app/javascript/pages/top-annual-contributors-page/CurrentYearTable.vuecontributors/app/javascript/pages/top-annual-contributors-page/CurrentYearTable.spec.ts
What was done
- Converted
CurrentYearTable.vueto<script setup lang="ts">, directly typing thecontributorsprop withGetApiV1LeaderboardResponse['records']. - Added unit tests for
CurrentYearTableinCurrentYearTable.spec.tscovering:- Passing
contributorsand defaultfilterData. - Passing custom
fromDateandtoDateinfilterData.
- Passing
- Simplified
createWrapper = (props = {}) =>to prevent type drift with component props. - Removed redundant
.exists()check and shallow stub snapshot test.
Verification
npm run typecheck && npm run lint && TZ=UTC npm run test -- CurrentYearTable --runAll type checks, linter, and tests passed locally.
Edited by Manish Kumar