Skip to content

test(gutenberg-to-portable-text): add transform tests - #332

Merged
ascorbic merged 4 commits into
emdash-cms:mainfrom
43081j:gutentests
Apr 7, 2026
Merged

ascorbic merged 4 commits into
emdash-cms:mainfrom
43081j:gutentests

Conversation

@43081j

@43081j 43081j commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This adds a bunch of tests, mostly for the transformers but also some
minor edge cases in the inline parser, too.

It also enables noUnusedLocals in tsconfig.json which caught a
couple of unused things.

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code

Copilot AI review requested due to automatic review settings April 6, 2026 22:35
@changeset-bot

changeset-bot Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7f8f4b2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@43081j

43081j commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copilot AI left a comment

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.

Pull request overview

Adds broader automated coverage for the gutenberg-to-portable-text converter and tightens TypeScript compiler checks.

Changes:

  • Added new conversion tests for basic HTML input, embeds (including provider inference), tables, buttons/buttons container, and galleries.
  • Added inline parser edge-case tests for empty href and unsafe/unknown URL schemes.
  • Enabled noUnusedLocals and removed a few now-flagged unused locals/imports.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/gutenberg-to-portable-text/tsconfig.json Enables noUnusedLocals for stricter TS hygiene.
packages/gutenberg-to-portable-text/tests/inline.test.ts Adds inline parsing edge-case tests for links.
packages/gutenberg-to-portable-text/tests/converter.test.ts Adds/extends converter test coverage across more block types and embed providers.
packages/gutenberg-to-portable-text/src/transformers/core.ts Removes an unused table-related local.
packages/gutenberg-to-portable-text/src/index.ts Removes unused transformer imports (keeps re-exports).

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

This adds a bunch of tests, mostly for the transformers but also some
minor edge cases in the inline parser, too.

It also enables `noUnusedLocals` in `tsconfig.json` which caught a
couple of unused things.
@pkg-pr-new

pkg-pr-new Bot commented Apr 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@332

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@332

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@332

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@332

emdash

npm i https://pkg.pr.new/emdash@332

create-emdash

npm i https://pkg.pr.new/create-emdash@332

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@332

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@332

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@332

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@332

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@332

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@332

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@332

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@332

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@332

commit: 7f8f4b2

@ascorbic ascorbic left a comment

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.

Thanks!

@ascorbic
ascorbic merged commit a996387 into emdash-cms:main Apr 7, 2026
25 checks passed
@43081j
43081j deleted the gutentests branch April 7, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants