Loading
Convert PendingSubmissionsPill.vue to TypeScript
Part of &33. Closes #880 (closed).
Scope
contributors/app/javascript/common/components/navigation-menu/PendingSubmissionsPill.vuecontributors/app/javascript/common/components/navigation-menu/PendingSubmissionsPill.spec.ts(renamed from.js)contributors/app/javascript/common/components/navigation-menu/__snapshots__/PendingSubmissionsPill.spec.ts.snap(renamed from.js.snap)contributors/app/javascript/api/submissions.tscontributors/app/javascript/api/submissions.spec.ts
What was done
- Converted
PendingSubmissionsPill.vueto<script setup lang="ts">. - Added
api/submissions.tswithfetchSubmissionsCount()to avoid calling axios directly in components. - Added
api/submissions.spec.tsusingPLACEHOLDER_AXIOS_RESPONSEper ADR 005. - Converted
PendingSubmissionsPill.spec.tsusingcreateVueData(),createAxiosError(), and mocked~/api/submissionsper ADR 005. - Inlined
{ count: 5 }and{ count: 7 }directly inPendingSubmissionsPill.spec.tsto keep the diff minimal and avoid factory conflicts with !3229. - Renamed snapshot file with
git mvin the same commit; snapshot content is unchanged. - Passed
fetchCountdirectly intowatch(() => state.version, fetchCount).
Verification
npm run typecheck && npm run lint && TZ=UTC npm run test -- --runAll test files and tests passed locally.
Edited by Manish Kumar