Skip to content

Commit 1b23c70

Browse files
committed
Fixes
1 parent 8cad7bd commit 1b23c70

File tree

3 files changed

+509
-25
lines changed

3 files changed

+509
-25
lines changed

tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts

+178
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,181 @@ export const exportParseEqualityTestInstancesBlockNoteHTML: TestInstance<
2121
testCase,
2222
executeTest: testExportParseEqualityBlockNoteHTML,
2323
}));
24+
25+
export const exportParseEqualityTestInstancesHTML: TestInstance<
26+
ExportParseEqualityTestCase<
27+
TestBlockSchema,
28+
TestInlineContentSchema,
29+
TestStyleSchema
30+
>,
31+
TestBlockSchema,
32+
TestInlineContentSchema,
33+
TestStyleSchema
34+
>[] = [
35+
{
36+
testCase: {
37+
name: "schema/blocks",
38+
content: [
39+
{
40+
type: "paragraph",
41+
content: "Paragraph",
42+
},
43+
{
44+
type: "heading",
45+
content: "Heading",
46+
},
47+
{
48+
type: "quote",
49+
content: "Quote",
50+
},
51+
{
52+
type: "bulletListItem",
53+
content: "Bullet List Item",
54+
},
55+
{
56+
type: "numberedListItem",
57+
content: "Numbered List Item",
58+
},
59+
{
60+
type: "checkListItem",
61+
content: "Check List Item",
62+
},
63+
{
64+
type: "codeBlock",
65+
content: "Code",
66+
},
67+
{
68+
type: "table",
69+
content: {
70+
type: "tableContent",
71+
rows: [
72+
{
73+
cells: ["Table Cell", "Table Cell"],
74+
},
75+
{
76+
cells: ["Table Cell", "Table Cell"],
77+
},
78+
],
79+
},
80+
},
81+
],
82+
},
83+
executeTest: testExportParseEqualityHTML,
84+
},
85+
{
86+
testCase: {
87+
name: "schema/blockProps",
88+
content: [
89+
{
90+
type: "paragraph",
91+
content: "Paragraph",
92+
props: {
93+
textColor: "red",
94+
backgroundColor: "blue",
95+
textAlignment: "center",
96+
},
97+
},
98+
{
99+
type: "heading",
100+
content: "Heading",
101+
props: {
102+
level: 2,
103+
},
104+
},
105+
{
106+
type: "checkListItem",
107+
content: "Check List Item",
108+
props: {
109+
checked: true,
110+
textColor: "red",
111+
backgroundColor: "blue",
112+
textAlignment: "center",
113+
},
114+
},
115+
{
116+
type: "codeBlock",
117+
content: "Code",
118+
props: { language: "javascript" },
119+
},
120+
],
121+
},
122+
executeTest: testExportParseEqualityHTML,
123+
},
124+
{
125+
testCase: {
126+
name: "schema/inlineContent",
127+
content: [
128+
{
129+
type: "paragraph",
130+
content: [
131+
{
132+
type: "text",
133+
text: "Text ",
134+
styles: {},
135+
},
136+
{
137+
type: "link",
138+
content: "Link",
139+
href: "https://example.com",
140+
},
141+
],
142+
},
143+
],
144+
},
145+
executeTest: testExportParseEqualityHTML,
146+
},
147+
{
148+
testCase: {
149+
name: "schema/styles",
150+
content: [
151+
{
152+
type: "paragraph",
153+
content: [
154+
{
155+
type: "text",
156+
text: "T",
157+
styles: {
158+
bold: true,
159+
italic: true,
160+
underline: true,
161+
strike: true,
162+
// Code cannot be applied on top of other styles.
163+
// code: true,
164+
textColor: "red",
165+
backgroundColor: "blue",
166+
},
167+
},
168+
],
169+
},
170+
],
171+
},
172+
executeTest: testExportParseEqualityHTML,
173+
},
174+
// TODO: Tests failing
175+
// {
176+
// testCase: {
177+
// name: "lists/nested",
178+
// content: [
179+
// {
180+
// type: "bulletListItem",
181+
// content: "List Item 1",
182+
// children: [
183+
// {
184+
// type: "bulletListItem",
185+
// content: "Nested List Item 1",
186+
// },
187+
// {
188+
// type: "bulletListItem",
189+
// content: "Nested List Item 2",
190+
// },
191+
// ],
192+
// },
193+
// {
194+
// type: "bulletListItem",
195+
// content: "List Item 2",
196+
// },
197+
// ],
198+
// },
199+
// executeTest: testExportParseEqualityHTML,
200+
// },
201+
];

0 commit comments

Comments
 (0)