Repository navigation
feat: Side menu component tests - #3417
matthewlipski wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
| }, | ||
| children: <AddBlockButton />, | ||
| }); | ||
| editor.getExtension(SideMenuExtension)!.store.setState({ |
| const original = editor.getBlock("table"); | ||
| expect(original?.type).toBe("table"); | ||
| if (original?.type !== "table") { | ||
| throw new Error("Expected table fixture"); |
There was a problem hiding this comment.
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
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
Additional Notes
N/A