Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .pnpm-store/v11/index.db
Binary file not shown.
395 changes: 281 additions & 114 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ overrides:
"@headlessui/react": "^2.2.4"
"@tiptap/core": "^3.0.0"
"@tiptap/pm": "^3.0.0"
"vitest": "4.1.2"
"@vitest/runner": "4.1.2"
"vitest": "4.1.7"
"@vitest/runner": "4.1.7"
"@y/prosemirror>lib0": "1.0.0-rc.13"
allowBuilds:
"@parcel/watcher": true
Expand Down
6 changes: 6 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# vitest-browser auto-saved debug screenshots on test failure (separate
# from `toMatchScreenshot` reference shots, which use `*-chromium-darwin.png`).
src/browser/**/__screenshots__/**/*-1.png

# vitest-browser attachments (debug artifacts saved during test runs).
.vitest-attachments
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"lint": "eslint src --max-warnings 0",
"playwright": "playwright test",
"test": "vitest --run",
"test:browser": "vitest --run --config ./vite.config.browser.ts",
"test:browser:updateSnaps": "vitest --run --config ./vite.config.browser.ts -u",
"test:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -u",
"test-ct": "playwright test -c playwright-ct.config.ts --headed",
"test-ct:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -c playwright-ct.config.ts -u",
Expand All @@ -24,6 +26,11 @@
"@types/node": "^20.19.22",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"@vitest/browser": "4.1.7",
"@vitest/browser-playwright": "4.1.7",
"@y/protocols": "^1.0.6-rc.1",
"@y/y": "^14.0.0-rc.16",
"eslint": "^8.57.1",
"htmlfy": "^0.6.7",
"react": "^19.2.5",
Expand All @@ -32,7 +39,8 @@
"rimraf": "^5.0.10",
"vite": "^8.0.8",
"vite-plugin-eslint": "^1.8.1",
"vitest": "^4.1.2"
"vitest": "4.1.7",
"vitest-browser-react": "^2.2.0"
},
"eslintConfig": {
"extends": [
Expand Down
13 changes: 13 additions & 0 deletions tests/src/browser/vitestSetup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { afterEach, beforeEach } from "vitest";

// Make BlockNote's `UniqueID` extension emit deterministic, incrementing
// numeric IDs instead of UUIDs. Snapshots that pick up auto-generated
// block ids (e.g. a trailing paragraph BlockNote injects after an image
// or heading) stay stable across runs.
beforeEach(() => {
(window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS = {};
});

afterEach(() => {
delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading