WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

A few `raw-handling` API unit tests fail in the native test environment #55652

Open fluiddot opened 1 year ago

fluiddot commented 1 year ago

Description

The following unit tests of raw-handling API fail when running them in the native test environment:

We currently don't run them as part of the mobile unit test suite (reference), but it would be recommended as the logic covered is used in the content pasting functionality used in the native version.

https://github.com/WordPress/gutenberg/blob/820b13599bf12f5efa472e36a780cd63e86a67b3/packages/blocks/src/api/raw-handling/paste-handler.js#L191-L222

In fact, I found that three of them produce a crash in the editor (only referencing iOS issues but we should expect the same on Android):

Step-by-step reproduction instructions

⚠️ : When copying HTML into the editor, use the button ) located in the top-right corner of the HTML content in GitHub.

ms-list-converter

  1. Create/open a post in the app.
  2. Copy the following HTML content:
```

* test

```
  1. Paste the HTML content into a Paragraph block.
  2. Observe the crash.

special-comment-converter

  1. Create/open a post in the app.
  2. Copy the following HTML content:
```

```
  1. Paste the HTML content into a Paragraph block.
  2. Observe the crash.

image-corrector

  1. Create/open a post in the app.
  2. Copy the following HTML content.
```
```
  1. Paste the HTML content into a Paragraph block.
  2. Observe the crash.

Expected behaviour

Actual behaviour

Screenshots or screen recording (optional)

N/A

WordPress information

Device information

fluiddot commented 11 months ago

The unit tests related to ms-list-converter will be enabled via https://github.com/WordPress/gutenberg/pull/56653.

fluiddot commented 11 months ago

ℹ️ Related to this issue, in https://github.com/WordPress/gutenberg/pull/56723 we discovered that several test cases related to processing raw blocks fail in the native version. As part of resolving this issue, we should enable/uncomment the test cases from test/native/integration/blocks-raw-handling.native.js and provide fixes to address the failures.