Skip to content

test: migrate unit tests from terse-pt to textspec - #2554

Merged
christianhg merged 1 commit into
mainfrom
textspec-unit-tests
Apr 29, 2026
Merged

test: migrate unit tests from terse-pt to textspec#2554
christianhg merged 1 commit into
mainfrom
textspec-unit-tests

Conversation

@christianhg

Copy link
Copy Markdown
Member

Migrates remaining unit-test usage of getTersePt from @portabletext/test to toTextspec from the editor package's test-utils.

getTersePt returns an array of terse-pt strings (one per block); textspec returns a single string with ;; between blocks and inline selection markers. Combining text and selection in one assertion drops paired selection assertions where they existed.

Doing this file-by-file as fixups so each migration is reviewable on its own. Tests pass on chromium per file.

@changeset-bot

changeset-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6ef412c

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

@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portable-text-editor-documentation Ready Ready Preview, Comment Apr 29, 2026 8:21am
portable-text-example-basic Ready Ready Preview, Comment Apr 29, 2026 8:21am
portable-text-playground Ready Ready Preview, Comment Apr 29, 2026 8:21am

Request Review

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @portabletext/editor

Compared against main (84e000f7)

@portabletext/editor

Metric Value vs main (84e000f)
Internal (raw) 733.6 KB -
Internal (gzip) 139.9 KB -
Bundled (raw) 1.33 MB -
Bundled (gzip) 300.1 KB -
Import time 93ms +0ms, +0.1%

@portabletext/editor/behaviors

Metric Value vs main (84e000f)
Internal (raw) 467 B -
Internal (gzip) 207 B -
Bundled (raw) 424 B -
Bundled (gzip) 171 B -
Import time 2ms +0ms, +1.3%

@portabletext/editor/plugins

Metric Value vs main (84e000f)
Internal (raw) 3.1 KB -
Internal (gzip) 967 B -
Bundled (raw) 2.9 KB -
Bundled (gzip) 899 B -
Import time 8ms -0ms, -0.4%

@portabletext/editor/selectors

Metric Value vs main (84e000f)
Internal (raw) 76.5 KB -
Internal (gzip) 13.7 KB -
Bundled (raw) 71.9 KB -
Bundled (gzip) 12.6 KB -
Import time 7ms +0ms, +0.8%

@portabletext/editor/utils

Metric Value vs main (84e000f)
Internal (raw) 27.8 KB -
Internal (gzip) 5.5 KB -
Bundled (raw) 25.4 KB -
Bundled (gzip) 5.1 KB -
Import time 6ms +0ms, +2.9%

🗺️ . · ./behaviors · ./plugins · ./selectors · ./utils · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@christianhg
christianhg force-pushed the textspec-unit-tests branch from 0787cd5 to 32daa9e Compare April 29, 2026 07:41
@christianhg
christianhg force-pushed the textspec-unit-tests branch from a986579 to 7c433bf Compare April 29, 2026 08:05
@christianhg
christianhg marked this pull request as ready for review April 29, 2026 08:32
@christianhg
christianhg merged commit d647791 into main Apr 29, 2026
17 checks passed
@christianhg
christianhg deleted the textspec-unit-tests branch April 29, 2026 08:32
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.

1 participant