← Back to PRs

#8964: test(msteams): add comprehensive tests for graph-upload module

by RajdeepKushwaha5 open 2026-02-04 17:24 View on GitHub →
channel: msteams gateway commands stale
## Summary Adds unit tests for the MS Teams graph-upload module which previously had no test coverage. ## Changes - Add 23 new tests covering all exported functions in `graph-upload.ts` - Tests cover success cases, error handling, and edge cases - Uses mock fetch pattern consistent with other msteams tests ## Testing - [x] All tests pass locally (`npx vitest run extensions/msteams/src/graph-upload.test.ts`) - [x] No TypeScript errors ## Checklist - [x] Tests focused on one module - [x] Follows existing testing patterns - [x] AI-assisted (Claude Opus 4.5 with Copilot) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new Vitest test suite for the MS Teams `graph-upload` module, covering OneDrive/SharePoint upload helpers, sharing-link creation, drive-item property lookups, and chat member retrieval via injected `fetchFn` and a mocked access token provider. The approach mirrors the module’s dependency-injection pattern (passing `fetchFn` + token provider) and exercises both success and error paths for the exported functions in `extensions/msteams/src/graph-upload.ts`. <h3>Confidence Score: 3/5</h3> - This PR is low-risk functionally, but several test assertions appear to be incorrect and may fail in CI. - Only a new test file is added, but multiple expectations don’t match the actual error strings thrown by the implementation (notably where response bodies are appended). I couldn’t execute tests in this environment (node/pnpm unavailable), so confidence relies on static verification against the source. - extensions/msteams/src/graph-upload.test.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs