Convert CurrentYearTable to TypeScript

Part of &33. Closes #868 (closed).

Scope

  • contributors/app/javascript/pages/top-annual-contributors-page/CurrentYearTable.vue
  • contributors/app/javascript/pages/top-annual-contributors-page/CurrentYearTable.spec.ts

What was done

  • Converted CurrentYearTable.vue to <script setup lang="ts">, directly typing the contributors prop with GetApiV1LeaderboardResponse['records'].
  • Added unit tests for CurrentYearTable in CurrentYearTable.spec.ts covering:
    • Passing contributors and default filterData.
    • Passing custom fromDate and toDate in filterData.
  • 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 --run

All type checks, linter, and tests passed locally.

Edited by Manish Kumar

Merge request reports

Loading
Loading