Skip to content

feat: Side menu component tests - #3417

Open
matthewlipski wants to merge 1 commit into
side-menu-styling-scopefrom
side-menu-a11y-tests
Open

matthewlipski wants to merge 1 commit into
side-menu-styling-scopefrom
side-menu-a11y-tests

Conversation

@matthewlipski

Copy link
Copy Markdown
Collaborator

Summary

This PR adds side menu component tests, similar to what we ended on with the formatting toolbar in #3177. Additionally, the testing skill has been updated based on things the LLM missed in the first few iterations I tried.

Rationale

This is the next step for implementing our new component/a11y testing setup for all UI components.

Changes

See above.

Impact

N/A

Testing

See above.

Screenshots/Video

N/A

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

N/A

@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
blocknote Error Error Nov 24, 2026 6:39pm UTC
blocknote-website Error Error Nov 24, 2026 6:39pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54e94e86-ddbc-47a6-8a8c-df86da51f7be

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3417

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3417

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3417

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3417

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3417

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3417

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3417

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3417

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3417

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3417

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3417

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3417

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3417

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3417

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3417

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3417

commit: a058ed2

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3417/

Built to branch gh-pages at 2026-11-24 18:47 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

},
children: <AddBlockButton />,
});
editor.getExtension(SideMenuExtension)!.store.setState({

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.

Love this pattern

const original = editor.getBlock("table");
expect(original?.type).toBe("table");
if (original?.type !== "table") {
throw new Error("Expected table fixture");

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.

instead of using this to do the type narrowing, use asserts:

import { assert } from "vite-plus/test";

 const original = editor.getBlock("table");
  assert(original?.type === 'table')

This will do the type narrowing after the assert to say that original must be a table block instance.

This should simplify all of the manual errors you have to throw in these tests

This branch had an error being deployed

2 failed deployments
Preview – blocknote — a058ed20 Deployed Nov 24, 2026 by vercel[bot]
Preview – blocknote-website — a058ed20 Deployed Nov 24, 2026 by vercel[bot]
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.

2 participants