Skip to content

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

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

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

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 browser-recording unit coverage for WebRTC session-description conversion and shared recorder utility behavior.

  • Tests offer and answer SDP conversion plus missing-description handling in the Chrome extension.
  • Tests recording-mode label heuristics, cancellation classification, and display-capture retry classification in recorder core.

Confidence Score: 4/5

The PR appears safe to merge, with only a non-blocking test-coverage mismatch for undefined session descriptions.

The added assertions match the current production behavior and supported Node runtime, but one test overstates its input coverage by checking null only.

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 accurate SDP conversion tests, but the missing-description test names undefined without exercising it.
packages/recorder-core/tests/recorder-utils.test.ts Adds recorder-mode and media-error classification tests that align with the current utility contracts and supported test runtime.
Prompt To Fix All With AI
### Issue 1
apps/chrome-extension/src/shared/webrtc.test.ts:81-86
**Undefined Case Remains Untested**

This test names both null and undefined handling but invokes `toSessionDescriptionInit` only with null, so an undefined-specific regression would remain undetected while the suite stays green.

```suggestion
	it.each([null, undefined])(
		"throws error when session description is %s",
		async (description) => {
			const { toSessionDescriptionInit } = await import("./webrtc");
			expect(() => toSessionDescriptionInit(description)).toThrow(
				"Missing session description",
			);
		},
	);
```

---

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

Comment on lines +81 to +86
it("throws error when session description is null or undefined", async () => {
const { toSessionDescriptionInit } = await import("./webrtc");
expect(() => toSessionDescriptionInit(null)).toThrow(
"Missing session description",
);
});

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 Remains Untested

This test names both null and undefined handling but invokes toSessionDescriptionInit only with null, so an undefined-specific regression would remain undetected while the suite stays green.

Suggested change
it("throws error when session description is null or undefined", async () => {
const { toSessionDescriptionInit } = await import("./webrtc");
expect(() => toSessionDescriptionInit(null)).toThrow(
"Missing session description",
);
});
it.each([null, undefined])(
"throws error when session description is %s",
async (description) => {
const { toSessionDescriptionInit } = await import("./webrtc");
expect(() => toSessionDescriptionInit(description)).toThrow(
"Missing session description",
);
},
);
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/chrome-extension/src/shared/webrtc.test.ts
Line: 81-86

Comment:
**Undefined Case Remains Untested**

This test names both null and undefined handling but invokes `toSessionDescriptionInit` only with null, so an undefined-specific regression would remain undetected while the suite stays green.

```suggestion
	it.each([null, undefined])(
		"throws error when session description is %s",
		async (description) => {
			const { toSessionDescriptionInit } = await import("./webrtc");
			expect(() => toSessionDescriptionInit(description)).toThrow(
				"Missing session description",
			);
		},
	);
```

---

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