Skip to content

Commit 56e079b

Browse files
committed
test: update tests to use snapshots
1 parent 4f5325f commit 56e079b

11 files changed

+689
-655
lines changed

examples/07-collaboration/01-partykit/App.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,5 @@ export default function App() {
3030
});
3131

3232
// Renders the editor instance.
33-
return (
34-
<BlockNoteView
35-
editor={editor}
36-
onChange={(e, { getChanges }) => {
37-
console.log(getChanges());
38-
}}
39-
/>
40-
);
33+
return <BlockNoteView editor={editor} />;
4134
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
[
2+
{
3+
"block": {
4+
"children": [
5+
{
6+
"children": [],
7+
"content": [
8+
{
9+
"styles": {},
10+
"text": "Double Nested Paragraph 0",
11+
"type": "text",
12+
},
13+
],
14+
"id": "double-nested-paragraph-0",
15+
"props": {
16+
"backgroundColor": "default",
17+
"textAlignment": "left",
18+
"textColor": "default",
19+
},
20+
"type": "paragraph",
21+
},
22+
],
23+
"content": [
24+
{
25+
"styles": {},
26+
"text": "Nested Paragraph 0",
27+
"type": "text",
28+
},
29+
],
30+
"id": "nested-paragraph-0",
31+
"props": {
32+
"backgroundColor": "default",
33+
"textAlignment": "left",
34+
"textColor": "default",
35+
},
36+
"type": "paragraph",
37+
},
38+
"prevBlock": undefined,
39+
"source": {
40+
"type": "local",
41+
},
42+
"type": "delete",
43+
},
44+
{
45+
"block": {
46+
"children": [],
47+
"content": [
48+
{
49+
"styles": {},
50+
"text": "Double Nested Paragraph 0",
51+
"type": "text",
52+
},
53+
],
54+
"id": "double-nested-paragraph-0",
55+
"props": {
56+
"backgroundColor": "default",
57+
"textAlignment": "left",
58+
"textColor": "default",
59+
},
60+
"type": "paragraph",
61+
},
62+
"prevBlock": undefined,
63+
"source": {
64+
"type": "local",
65+
},
66+
"type": "delete",
67+
},
68+
{
69+
"block": {
70+
"children": [],
71+
"content": [
72+
{
73+
"styles": {},
74+
"text": "Paragraph with children",
75+
"type": "text",
76+
},
77+
],
78+
"id": "paragraph-with-children",
79+
"props": {
80+
"backgroundColor": "default",
81+
"textAlignment": "left",
82+
"textColor": "default",
83+
},
84+
"type": "paragraph",
85+
},
86+
"prevBlock": {
87+
"children": [
88+
{
89+
"children": [
90+
{
91+
"children": [],
92+
"content": [
93+
{
94+
"styles": {},
95+
"text": "Double Nested Paragraph 0",
96+
"type": "text",
97+
},
98+
],
99+
"id": "double-nested-paragraph-0",
100+
"props": {
101+
"backgroundColor": "default",
102+
"textAlignment": "left",
103+
"textColor": "default",
104+
},
105+
"type": "paragraph",
106+
},
107+
],
108+
"content": [
109+
{
110+
"styles": {},
111+
"text": "Nested Paragraph 0",
112+
"type": "text",
113+
},
114+
],
115+
"id": "nested-paragraph-0",
116+
"props": {
117+
"backgroundColor": "default",
118+
"textAlignment": "left",
119+
"textColor": "default",
120+
},
121+
"type": "paragraph",
122+
},
123+
],
124+
"content": [
125+
{
126+
"styles": {},
127+
"text": "Paragraph with children",
128+
"type": "text",
129+
},
130+
],
131+
"id": "paragraph-with-children",
132+
"props": {
133+
"backgroundColor": "default",
134+
"textAlignment": "left",
135+
"textColor": "default",
136+
},
137+
"type": "paragraph",
138+
},
139+
"source": {
140+
"type": "local",
141+
},
142+
"type": "update",
143+
},
144+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "Paragraph 0",
9+
"type": "text",
10+
},
11+
],
12+
"id": "paragraph-0",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"prevBlock": undefined,
21+
"source": {
22+
"type": "local",
23+
},
24+
"type": "delete",
25+
},
26+
]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[
2+
{
3+
"block": {
4+
"children": [
5+
{
6+
"children": [],
7+
"content": [
8+
{
9+
"styles": {},
10+
"text": "Nested",
11+
"type": "text",
12+
},
13+
],
14+
"id": "1",
15+
"props": {
16+
"backgroundColor": "default",
17+
"textAlignment": "left",
18+
"textColor": "default",
19+
},
20+
"type": "paragraph",
21+
},
22+
],
23+
"content": [],
24+
"id": "0",
25+
"props": {
26+
"backgroundColor": "default",
27+
"textAlignment": "left",
28+
"textColor": "default",
29+
},
30+
"type": "paragraph",
31+
},
32+
"prevBlock": undefined,
33+
"source": {
34+
"type": "local",
35+
},
36+
"type": "insert",
37+
},
38+
{
39+
"block": {
40+
"children": [],
41+
"content": [
42+
{
43+
"styles": {},
44+
"text": "Nested",
45+
"type": "text",
46+
},
47+
],
48+
"id": "1",
49+
"props": {
50+
"backgroundColor": "default",
51+
"textAlignment": "left",
52+
"textColor": "default",
53+
},
54+
"type": "paragraph",
55+
},
56+
"prevBlock": undefined,
57+
"source": {
58+
"type": "local",
59+
},
60+
"type": "insert",
61+
},
62+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [],
6+
"id": "0",
7+
"props": {
8+
"backgroundColor": "default",
9+
"textAlignment": "left",
10+
"textColor": "default",
11+
},
12+
"type": "paragraph",
13+
},
14+
"prevBlock": undefined,
15+
"source": {
16+
"type": "local",
17+
},
18+
"type": "insert",
19+
},
20+
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "ABC",
9+
"type": "text",
10+
},
11+
],
12+
"id": "0",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"prevBlock": undefined,
21+
"source": {
22+
"type": "local",
23+
},
24+
"type": "insert",
25+
},
26+
{
27+
"block": {
28+
"children": [],
29+
"content": [
30+
{
31+
"styles": {},
32+
"text": "DEF",
33+
"type": "text",
34+
},
35+
],
36+
"id": "1",
37+
"props": {
38+
"backgroundColor": "default",
39+
"textAlignment": "left",
40+
"textColor": "default",
41+
},
42+
"type": "paragraph",
43+
},
44+
"prevBlock": undefined,
45+
"source": {
46+
"type": "local",
47+
},
48+
"type": "insert",
49+
},
50+
]

0 commit comments

Comments
 (0)