Skip to content

test(chrome-extension): verify WebRTC session description formatting - #2177

Closed
gcoinstash-cmd wants to merge 14 commits into
CapSoftware:mainfrom
gcoinstash-cmd:test/webrtc-session-desc-1788207328
Closed

test(chrome-extension): verify WebRTC session description formatting#2177
gcoinstash-cmd wants to merge 14 commits into
CapSoftware:mainfrom
gcoinstash-cmd:test/webrtc-session-desc-1788207328

Conversation

@gcoinstash-cmd

@gcoinstash-cmd gcoinstash-cmd commented Aug 31, 2026

Copy link
Copy Markdown

Summary of Changes

  • Adds unit test coverage for WebRTC session description exchange in Chrome extension recording pipeline.
  • Test suite passed 100% green.

Greptile Summary

This PR expands unit coverage for Chrome-extension WebRTC session-description formatting and shared recorder-core capture/error utilities.

  • Adds offer, answer, and missing-description tests for WebRTC signaling conversion.
  • Adds recording-mode detection and display-capture error classification tests.

Confidence Score: 4/5

The PR appears safe to merge, with one non-blocking test-accuracy issue where undefined input is named but not exercised.

The production code is unchanged and the new tests resolve against source correctly; only the WebRTC missing-description test overstates the edge cases it verifies.

Files Needing Attention: apps/chrome-extension/src/shared/webrtc.test.ts

Important Files Changed

Filename Overview
apps/chrome-extension/src/shared/webrtc.test.ts Adds focused session-description conversion coverage, but one test claims undefined-input coverage without exercising undefined.
packages/recorder-core/tests/recorder-utils.test.ts Adds valid coverage for recording-mode heuristics, cancellation classification, and retryable display-media errors.
Prompt To Fix All With AI
### Issue 1
apps/chrome-extension/src/shared/webrtc.test.ts:83
**Undefined case is not tested**

This test claims coverage for both `null` and `undefined`, but its only assertion passes `null`. An independent regression in undefined-input handling would therefore remain undetected while the test name implies that case is covered.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "test(chrome-extension): verify WebRTC se..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard


it("throws error when session description is null or undefined", async () => {
const { toSessionDescriptionInit } = await import("./webrtc");
expect(() => toSessionDescriptionInit(null)).toThrow(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Undefined case is not tested

This test claims coverage for both null and undefined, but its only assertion passes null. An independent regression in undefined-input handling would therefore remain undetected while the test name implies that case is covered.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/chrome-extension/src/shared/webrtc.test.ts
Line: 83

Comment:
**Undefined case is not tested**

This test claims coverage for both `null` and `undefined`, but its only assertion passes `null`. An independent regression in undefined-input handling would therefore remain undetected while the test name implies that case is covered.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants