Skip to content

Commit caf7ffd

Browse files
committed
Updated/fixed most e2e tests
1 parent 59a7a63 commit caf7ffd

23 files changed

+538
-30
lines changed

packages/core/src/blocks/ListItem/BulletListItem/block.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export const createBulletListItemBlockSpec = createBlockSpec(
9191
return {
9292
type: "bulletListItem",
9393
props: {},
94-
content: [],
9594
};
9695
},
9796
},

packages/core/src/blocks/ListItem/CheckListItem/block.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export const createCheckListItemBlockSpec = createBlockSpec(
136136
props: {
137137
checked: true,
138138
},
139-
content: [],
140139
};
141140
},
142141
},

packages/core/src/blocks/ListItem/NumberedListItem/block.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const createNumberedListItemBlockSpec = createBlockSpec(
7373
props: {
7474
start: parseInt(match[1]),
7575
},
76-
content: [],
7776
};
7877
},
7978
},

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,12 @@ export class BlockNoteEditor<
846846
blockInfo.blockContent.node.type.spec
847847
.content === "inline*"
848848
) {
849+
const tr = state.tr.deleteRange(
850+
range.from,
851+
range.to,
852+
);
849853
updateBlockTr(
850-
state.tr,
854+
tr,
851855
blockInfo.bnBlock.beforePos,
852856
replaceWith,
853857
range.from,

tests/src/end-to-end/customblocks/customblocks.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ test.describe("Check custom block functionality", () => {
1212
}) => {
1313
await page.goto(CUSTOM_BLOCKS_VANILLA_URL);
1414

15-
await page.waitForTimeout(500);
16-
await page.locator("select").click();
17-
await page.keyboard.press("ArrowUp");
18-
await page.keyboard.press("Enter");
15+
await page.locator("select").selectOption("info");
1916
await page.waitForTimeout(500);
2017

2118
await compareDocToSnapshot(page, "vanillaInteractivity");
@@ -29,10 +26,7 @@ test.describe("Check custom block functionality", () => {
2926
}) => {
3027
await page.goto(CUSTOM_BLOCKS_REACT_URL);
3128

32-
await page.waitForTimeout(500);
33-
await page.locator("select").click();
34-
await page.keyboard.press("ArrowUp");
35-
await page.keyboard.press("Enter");
29+
await page.locator("select").selectOption("info");
3630
await page.waitForTimeout(500);
3731

3832
await compareDocToSnapshot(page, "reactInteractivity");
102 KB
Loading
150 KB
Loading
315 KB
Loading
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"type": "doc",
3+
"content": [
4+
{
5+
"type": "blockGroup",
6+
"content": [
7+
{
8+
"type": "blockContainer",
9+
"attrs": {
10+
"id": "0",
11+
"textColor": "default",
12+
"backgroundColor": "default"
13+
},
14+
"content": [
15+
{
16+
"type": "alert",
17+
"attrs": {
18+
"textAlignment": "left",
19+
"type": "info"
20+
},
21+
"content": [
22+
{
23+
"type": "text",
24+
"text": "Alert"
25+
}
26+
]
27+
}
28+
]
29+
},
30+
{
31+
"type": "blockContainer",
32+
"attrs": {
33+
"id": "1",
34+
"textColor": "default",
35+
"backgroundColor": "default"
36+
},
37+
"content": [
38+
{
39+
"type": "simpleImage",
40+
"attrs": {
41+
"src": "https://t3.ftcdn.net/jpg/02/48/42/64/360_F_248426448_NVKLywWqArG2ADUxDq6QprtIzsF82dMF.jpg"
42+
}
43+
}
44+
]
45+
},
46+
{
47+
"type": "blockContainer",
48+
"attrs": {
49+
"id": "2",
50+
"textColor": "default",
51+
"backgroundColor": "default"
52+
},
53+
"content": [
54+
{
55+
"type": "bracketsParagraph",
56+
"attrs": {
57+
"textAlignment": "left"
58+
},
59+
"content": [
60+
{
61+
"type": "text",
62+
"text": "Brackets Paragraph"
63+
}
64+
]
65+
}
66+
]
67+
},
68+
{
69+
"type": "blockContainer",
70+
"attrs": {
71+
"id": "3",
72+
"textColor": "default",
73+
"backgroundColor": "default"
74+
},
75+
"content": [
76+
{
77+
"type": "paragraph",
78+
"attrs": {
79+
"textAlignment": "left"
80+
}
81+
}
82+
]
83+
}
84+
]
85+
}
86+
]
87+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"type": "doc",
3+
"content": [
4+
{
5+
"type": "blockGroup",
6+
"content": [
7+
{
8+
"type": "blockContainer",
9+
"attrs": {
10+
"id": "0",
11+
"textColor": "default",
12+
"backgroundColor": "default"
13+
},
14+
"content": [
15+
{
16+
"type": "alert",
17+
"attrs": {
18+
"textAlignment": "left",
19+
"type": "info"
20+
},
21+
"content": [
22+
{
23+
"type": "text",
24+
"text": "Alert"
25+
}
26+
]
27+
}
28+
]
29+
},
30+
{
31+
"type": "blockContainer",
32+
"attrs": {
33+
"id": "1",
34+
"textColor": "default",
35+
"backgroundColor": "default"
36+
},
37+
"content": [
38+
{
39+
"type": "simpleImage",
40+
"attrs": {
41+
"src": "https://t3.ftcdn.net/jpg/02/48/42/64/360_F_248426448_NVKLywWqArG2ADUxDq6QprtIzsF82dMF.jpg"
42+
}
43+
}
44+
]
45+
},
46+
{
47+
"type": "blockContainer",
48+
"attrs": {
49+
"id": "2",
50+
"textColor": "default",
51+
"backgroundColor": "default"
52+
},
53+
"content": [
54+
{
55+
"type": "bracketsParagraph",
56+
"attrs": {
57+
"textAlignment": "left"
58+
},
59+
"content": [
60+
{
61+
"type": "text",
62+
"text": "Brackets Paragraph"
63+
}
64+
]
65+
}
66+
]
67+
},
68+
{
69+
"type": "blockContainer",
70+
"attrs": {
71+
"id": "3",
72+
"textColor": "default",
73+
"backgroundColor": "default"
74+
},
75+
"content": [
76+
{
77+
"type": "paragraph",
78+
"attrs": {
79+
"textAlignment": "left"
80+
}
81+
}
82+
]
83+
}
84+
]
85+
}
86+
]
87+
}

0 commit comments

Comments
 (0)