Skip to content

test: Assert iOS WebView globals configuration #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Apr 21, 2025

What?

Assert iOS WebView global configuration. Close CMM-284.

Related: wordpress-mobile/WordPress-iOS#24485

Why?

Avoid regressions within the regex and string manipulation.

How?

Add automated unit tests.

Testing Instructions

N/A, no user-facing changes.

Accessibility Testing Instructions

N/A, no user-facing changes.

Screenshots or screencast

N/A, no user-facing changes.

@dcalhoun dcalhoun added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Apr 21, 2025
@dcalhoun dcalhoun marked this pull request as ready for review April 21, 2025 19:50
@dcalhoun dcalhoun enabled auto-merge (squash) April 21, 2025 19:51
@dcalhoun dcalhoun requested a review from Copilot April 21, 2025 20:56
Copy link

@Copilot 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 adds unit tests to assert the iOS WebView global configuration and updates the initializer for WebViewGlobal to throw a proper error when provided with an invalid JavaScript identifier.

  • Adds tests for various WebViewGlobal value conversions and identifier validations.
  • Updates the WebViewGlobal initializer to throw an error instead of calling preconditionFailure.
  • Introduces a new error enum (WebViewGlobalError) for improved error handling.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ios/Tests/GutenbergKitTests/EditorConfigurationTests.swift Added comprehensive unit tests for validating JavaScript identifiers and conversion of WebViewGlobalValue.
ios/Sources/GutenbergKit/Sources/EditorConfiguration.swift Modified the initializer to throw an error on invalid JavaScript identifiers and added the WebViewGlobalError enum.

@dcalhoun dcalhoun requested a review from kean April 21, 2025 21:03
@dcalhoun dcalhoun merged commit fc36907 into trunk Apr 23, 2025
9 checks passed
@dcalhoun dcalhoun deleted the test/assert-ios-web-globals branch April 23, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants