Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@types/uuid": "8.3.1",
"@wordpress/build": "file:./packages/wp-build",
"@wordpress/vips": "file:./packages/vips",
"ajv": "8.17.1",
"babel-jest": "29.7.0",
"babel-loader": "9.2.1",
"babel-plugin-inline-json-import": "0.3.2",
Expand Down Expand Up @@ -252,6 +251,7 @@
"routes/*",
"storybook",
"test/e2e",
"test/integration",
"test/performance",
Comment on lines 244 to 246

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

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

PR description mentions adding test:integration/watch/debug scripts and a test/integration/jest.config.js, but those changes aren’t present (root scripts still only include unit-test runners, and test/integration/ has no jest config). Either update the PR description or include the missing script/config changes so the workspace can actually be executed independently as described.

Copilot uses AI. Check for mistakes.
"test/storybook-playwright",
"test/unit",
Expand Down
58 changes: 58 additions & 0 deletions test/integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Integration Tests

This directory contains the integration test suite for the Gutenberg project, published as the `@wordpress/integration-tests` workspace package.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not published.


## What Are Integration Tests?

Unlike unit tests that test individual functions in isolation, these tests exercise multiple packages working together. They cover:

| Test file | What it tests |
|---|---|
| `blocks-schema.test.js` | Validates all `block.json` files in the repo against the JSON schema |
| `theme-schema.test.js` | Validates all `theme.json` files in the repo against the JSON schema |
| `wp-env-schema.test.js` | Validates `.wp-env.json` against the JSON schema |
| `blocks-raw-handling.test.js` | Tests raw paste/HTML handling across the full block pipeline |
| `full-content/full-content.test.js` | Tests full block serialization round-trips using fixtures |
| `is-valid-block.test.js` | Tests block validation with editor hooks applied |
| `shortcode-converter.test.js` | Tests shortcode-to-block conversion |
| `non-matched-tags-handling.test.js` | Tests handling of unrecognized HTML tags during paste |

## Running the Tests

Integration tests run as part of the standard unit test command:

```bash
npm run test:unit
```

To run only the integration tests:

```bash
npm run test:unit -- test/integration
```

To run a specific integration test file:

```bash
npm run test:unit -- test/integration/blocks-schema.test.js
```

## Fixtures

The `fixtures/blocks/` directory contains serialized block fixtures used by `full-content.test.js` to verify that blocks serialize and parse correctly.

To generate missing fixtures:

```bash
npm run fixtures:generate
```

To regenerate all fixtures from scratch:

```bash
npm run fixtures:regenerate
```

## Jest Configuration

These tests reuse the Jest configuration from `test/unit/jest.config.js`. There is no separate Jest config in this directory — `test/unit`'s config sets `rootDir` to the repo root, which automatically discovers tests in this directory.
39 changes: 39 additions & 0 deletions test/integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@wordpress/integration-tests",
"version": "0.0.0",
"description": "Integration tests for WordPress Gutenberg.",
"private": true,
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"wordpress",
"gutenberg",
"integration-tests"
],
"homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/README.md",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This file doesn't exist. Let us create one.

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

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

The homepage points to test/integration/README.md, but there is no README.md at test/integration/ (only READMEs deeper in fixtures). This makes the package metadata link dead; either add test/integration/README.md or update the homepage URL to the directory (without README.md).

Suggested change
"homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/README.md",
"homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/test/integration/",

Copilot uses AI. Check for mistakes.
"repository": {
"type": "git",
"url": "git+https://github.com/WordPress/gutenberg.git",
"directory": "test/integration"
},
"bugs": {
"url": "https://github.com/WordPress/gutenberg/issues"
},
"devDependencies": {
Comment on lines +21 to +22

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

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

Other test workspaces define workspace-scoped scripts and include the runner dependency they use (e.g. @wordpress/unit-tests includes @wordpress/scripts and test:unit* scripts in test/unit/package.json:22-48, and e2e/performance do similarly). This new @wordpress/integration-tests package currently has no scripts and no @wordpress/scripts; if the intent is to run integration tests independently via npm run --workspace @wordpress/integration-tests …, add the corresponding scripts and required devDependencies to match that established pattern.

Suggested change
},
"devDependencies": {
},
"scripts": {
"test:integration": "wp-scripts test-unit-js",
"test:integration:watch": "npm run test:integration -- --watch"
},
"devDependencies": {
"@wordpress/scripts": "^30.13.0",

Copilot uses AI. Check for mistakes.
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@wordpress/block-editor": "file:../../packages/block-editor",
"@wordpress/block-library": "file:../../packages/block-library",
"@wordpress/block-serialization-default-parser": "file:../../packages/block-serialization-default-parser",
"@wordpress/blocks": "file:../../packages/blocks",
"@wordpress/data": "file:../../packages/data",
"@wordpress/element": "file:../../packages/element",
"@wordpress/prettier-config": "file:../../packages/prettier-config",
"@wordpress/rich-text": "file:../../packages/rich-text",
"ajv": "^8.17.1",
"fast-glob": "^3.2.7"
},
Comment on lines +22 to +35

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let us ensure that we declare all the dependencies that the workspace uses.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, agv can be removed from root package.json

"publishConfig": {
"access": "public"
}
}
Loading