Skip to content

test(sdk): Add integration tests for Teams adapter class methods #772

Closed

Description

@diberry

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 remain untested:

  • ensureAuthenticated() — token lifecycle (cache/refresh/PKCE/device code)
  • ensureChat() — chat creation/lookup
  • postUpdate() — message posting to chats and channels
  • pollForReplies() — message polling with filtering

These require Graph API mocking but are the highest-risk code paths.

What to do

Add integration tests using a mocked fetch (e.g., vi.stubGlobal('fetch', ...) or msw) that cover:

  1. Token refresh flow (expired → refresh → success)
  2. Token refresh failure → re-auth fallback
  3. postUpdate to chat vs channel
  4. pollForReplies filtering out own messages
  5. pollForReplies error → warning logged + empty array returned
  6. ensureChat with recipientUpn vs me mode

Origin

Flagged by FIDO (quality review) during PR #768 review — Round 2 non-blocking note.

Severity: MEDIUM (future work)
Related PR: #768

Activity

  1. added
    squadSquad triage inbox — Lead will assign to a member
    on Apr 3, 2026
  2. github-actions commented on Apr 3, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #772 — test(sdk): Add integration tests for Teams adapter class methods
    Assigned to: FIDO (Quality Owner)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: 🔴 Not suitable — issue involves work outside the coding agent's capability profile.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  3. added 2 commits that reference this issue on Apr 6, 2026
    eff1ae1
    a51cac0
  4. diberry commented on Apr 6, 2026

    @diberry
    ContributorAuthor

    ✈️ Flight Triage

    Category: In progress — PR #883 covers this. No PRD needed.

    Assessment: Teams adapter integration tests (#772), channelId encoding (#771), and icacls warning (#770) are all being addressed in PR #883. These three issues share the same origin (PR #768 review feedback from FIDO and RETRO).

    Action: No action needed — tracking via PR #883. Will close when PR merges.

  5. diberry commented on Apr 10, 2026

    @diberry
    ContributorAuthor

    🔒 On hold — focusing on low-touch and medium-touch issues first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions