Skip to content

test(e2e): fix tests that fail when the whole suite runs on one server - #4517

Merged
ascorbic merged 1 commit into
emdash-cms:mainfrom
endformdev:e2e/single-server-test-fixes
Nov 4, 2026
Merged

ascorbic merged 1 commit into
emdash-cms:mainfrom
endformdev:e2e/single-server-test-fixes

Conversation

@ostenbom

@ostenbom ostenbom commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Three Node E2E tests fail when the whole suite runs against one server, as it does in a full local pnpm test:e2e run. CI doesn't catch them because each of its 8 shards gets its own server and database.

  • sandbox-plugin-admin-surfaces: the hook-events check read the first 100 events, and a full run records more. The test plugin's events-list route now takes ids, and the test looks up its own two events.
  • sandbox-plugin-boundaries: it expected exactly one user, but after the passkey setup test there are two. It now checks that the dev admin is in the list.
  • media-library drag into a folder: in a crowded root folder the dragged row sat at the viewport's edge, where dnd-kit auto-scrolls. The drag helper now scrolls the row to the centre and re-measures the drop target. It still fails now and then when the folder is very crowded.

This is independent of the two E2E speed-up PRs (#4518 and #4519), but you need it for a full local run of either.

I used claude to help me create this PR, but I have run the suite and reviewed the code myself.

Type of change

  • Bug fix
  • Feature (requires an accepted feature plan or RFC)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Your connection to this change

  • I use EmDash and ran into the problem this PR addresses
  • I maintain a tool, dependency, or service that EmDash uses, and this change concerns that integration
  • A Maintainer approved this specific change before I opened the PR

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change): the full Node suite on one server, with these fixes, locally against both the dev server and a production build
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable): not applicable
  • I have added and reviewed the user-facing changeset (if this PR changes a published package): not applicable, @emdash-cms/plugin-marketplace-test is private
  • New features link to their merged design PR: not applicable
  • I have included screenshots below if this PR changes the UI: not applicable

AI assistance disclosure

  • This PR includes AI-generated code or text — model/tool: Claude Opus 5.5 (Claude Code)

Screenshots / test output

Not applicable.

CI splits the Node suite over 8 shards, each with its own server, so
these only fail in a full run against a single server:

- The sandbox hook-event test listed the test plugin's events with
  limit 100; a full run records more. The plugin's events-list route
  now accepts `ids` for a direct lookup.
- The sandbox user-list check required exactly one user, but the
  passkey setup test adds a second.
- In a crowded root folder the dragged media row sat at the viewport's
  bottom edge, where dnd-kit auto-scrolls and the drop target moves.
  pointerDrag now scrolls the source to the centre and re-measures the
  target during the drag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Oct 29, 2026
@changeset-bot

changeset-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2bebc6a

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

@emdashbot emdashbot Bot 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.

The approach is sound: the tests now assert on the data they create instead of assuming a fresh database, which breaks when CI shards share a server. The drag helper also stays on the real drag-and-drop path. Both reviewers approved with no findings. They found no production code changes and no changeset needed, since the plugin package is private. The events-list ids branch uses getMany, which the sandbox wrappers support. Requests without valid ids keep the old query path. The users check keeps meaningful coverage while allowing the extra passkey user. Both reviews were static and ran no checks. Neither confirmed that the drag adjustment removes the flakiness the PR says remains in a very crowded root folder.


Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.

@ostenbom

Copy link
Copy Markdown
Contributor Author

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

github-actions Bot added a commit that referenced this pull request Oct 29, 2026

@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!

@emdashbot emdashbot Bot added review/needs-review No maintainer or bot review yet and removed review/needs-review No maintainer or bot review yet labels Nov 4, 2026
@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-review No maintainer or bot review yet labels Nov 4, 2026
@ascorbic
ascorbic enabled auto-merge (squash) November 4, 2026 10:42
@ascorbic
ascorbic merged commit 4b7c7e5 into emdash-cms:main Nov 4, 2026
44 of 45 checks passed
@emdashbot

emdashbot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing to EmDash! 🎉

Join the EmDash Discord, then run /link to connect your GitHub account and claim the Contributor role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants