Skip to content

fixing test coverage for serialize iframes#2137

Merged
bhokaremoin merged 2 commits intomasterfrom
test-coverage-fix
Mar 10, 2026
Merged

fixing test coverage for serialize iframes#2137
bhokaremoin merged 2 commits intomasterfrom
test-coverage-fix

Conversation

@bhokaremoin
Copy link
Copy Markdown
Contributor

@bhokaremoin bhokaremoin commented Mar 10, 2026

This pull request adds new tests to the serializeFrames suite to improve robustness and error handling around iframe serialization. The main focus is ensuring that serialization works correctly without Trusted Types and that errors in setAttribute are handled gracefully.

Improvements to iframe serialization robustness:

  • Added a test to verify that iframe srcdoc serialization works correctly even when window.trustedTypes is not available, ensuring fallback behavior is reliable.
  • Added a test to ensure that errors thrown by setAttribute (specifically for the srcdoc attribute) are handled gracefully and do not break serialization, improving error resilience.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the serializeFrames test suite to cover additional iframe srcdoc serialization scenarios, specifically around Trusted Types availability and error handling when setting attributes.

Changes:

  • Added a test ensuring srcdoc serialization still works when window.trustedTypes is unavailable (fallback path).
  • Added a test ensuring serialization does not throw if setAttribute('srcdoc', ...) throws.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bhokaremoin bhokaremoin merged commit 562a09d into master Mar 10, 2026
41 checks passed
@bhokaremoin bhokaremoin deleted the test-coverage-fix branch March 10, 2026 13:44
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.

3 participants