Title: test(sdk): Add integration tests for Teams adapter class methods · Issue #772 · github/squad · GitHub
Open Graph Title: test(sdk): Add integration tests for Teams adapter class methods · Issue #772 · github/squad
X Title: test(sdk): Add integration tests for Teams adapter class methods · Issue #772 · github/squad
Description: Context PR #768 added 32 unit tests for the Teams adapter's pure helper functions (escapeHtml, stripHtml, formatTeamsMessage, parseTokens, base64url, validateGraphId). These cover the exported utilities well. However, the class methods r...
Open Graph Description: Context PR #768 added 32 unit tests for the Teams adapter's pure helper functions (escapeHtml, stripHtml, formatTeamsMessage, parseTokens, base64url, validateGraphId). These cover the exported util...
X Description: Context PR #768 added 32 unit tests for the Teams adapter's pure helper functions (escapeHtml, stripHtml, formatTeamsMessage, parseTokens, base64url, validateGraphId). These cover the exported ...
Opengraph URL: https://github.com/github/squad/issues/772
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test(sdk): Add integration tests for Teams adapter class methods","articleBody":"## Context\n\nPR #768 added 32 unit tests for the Teams adapter's pure helper functions (`escapeHtml`, `stripHtml`, `formatTeamsMessage`, `parseTokens`, `base64url`, `validateGraphId`). These cover the exported utilities well.\n\nHowever, the class methods remain untested:\n- `ensureAuthenticated()` — token lifecycle (cache/refresh/PKCE/device code)\n- `ensureChat()` — chat creation/lookup\n- `postUpdate()` — message posting to chats and channels\n- `pollForReplies()` — message polling with filtering\n\nThese require Graph API mocking but are the highest-risk code paths.\n\n## What to do\n\nAdd integration tests using a mocked `fetch` (e.g., `vi.stubGlobal('fetch', ...)` or `msw`) that cover:\n1. Token refresh flow (expired → refresh → success)\n2. Token refresh failure → re-auth fallback\n3. `postUpdate` to chat vs channel\n4. `pollForReplies` filtering out own messages\n5. `pollForReplies` error → warning logged + empty array returned\n6. `ensureChat` with `recipientUpn` vs `me` mode\n\n## Origin\n\nFlagged by FIDO (quality review) during PR #768 review — Round 2 non-blocking note.\n\n**Severity:** MEDIUM (future work)\n**Related PR:** #768","author":{"url":"https://github.com/diberry","@type":"Person","name":"diberry"},"datePublished":"2026-04-03T00:09:58Z","url":"https://github.com/github/squad/issues/772"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1798ab15-ad00-1c11-d974-bc3a58afef1e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF44:3C34D:4A397B:620844:6B017769 |
| html-safe-nonce | e8a0b28857b501e5d727eca53ec7320ca28b9b9ed19057bd2c909514c7b6bf36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjQ0OjNDMzREOjRBMzk3Qjo2MjA4NDQ6NkIwMTc3NjkiLCJ2aXNpdG9yX2lkIjoiMjU5Mzc0NTYwMzg0NjU2Nzc4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d898698943722fca02300d196a9e9164c6a61e73d096d39b7cc421a9fbb02655 |
| hovercard-subject-tag | issue:4197547811 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/squad/772/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15494e1ddf8414a1c23c0e20863183c49031fa6ddc6ee54a418fb3e96dbc9977/github/squad/issues/772 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15494e1ddf8414a1c23c0e20863183c49031fa6ddc6ee54a418fb3e96dbc9977/github/squad/issues/772 |
| og:image:alt | Context PR #768 added 32 unit tests for the Teams adapter's pure helper functions (escapeHtml, stripHtml, formatTeamsMessage, parseTokens, base64url, validateGraphId). These cover the exported util... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | diberry |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/github/squad git https://github.com/github/squad.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 1151205052 |
| octolytics-dimension-repository_nwo | github/squad |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1151205052 |
| octolytics-dimension-repository_network_root_nwo | github/squad |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width