update markdown parsing tests
This commit is contained in:
parent
e408dcc27e
commit
6ed11a7da7
@ -1,6 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile a markdown ordered list 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile a markdown ordered list 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -80,7 +80,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile bulleted lists 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile bulleted lists 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -160,7 +160,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile code blocks 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile code blocks 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -183,28 +183,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile hard breaks (double space) 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
Object {
|
||||
"data": undefined,
|
||||
"kind": "text",
|
||||
"text": "blue moon
|
||||
footballs",
|
||||
},
|
||||
],
|
||||
"type": "paragraph",
|
||||
},
|
||||
],
|
||||
"type": "root",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile horizontal rules 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile horizontal rules 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -241,7 +220,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile horizontal rules 2`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile horizontal rules 2`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -278,7 +257,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile images 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile images 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -298,7 +277,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile inline code 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile inline code 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -348,7 +327,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile kitchen sink example 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile kitchen sink example 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1048,7 +1027,7 @@ not using the official implementation, and this might work subtly differently
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile links 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile links 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1099,7 +1078,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile multiple header levels 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile multiple header levels 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1141,7 +1120,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile nested inline markup 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile nested inline markup 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1235,7 +1214,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile plugins 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile plugins 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1266,7 +1245,7 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Prosemirror document structure should compile simple markdown 1`] = `
|
||||
exports[`Compile markdown to Slate Raw AST should compile simple markdown 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
@ -1296,3 +1275,34 @@ Object {
|
||||
"type": "root",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Compile markdown to Slate Raw AST should compile soft breaks (double space) 1`] = `
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
Object {
|
||||
"kind": "block",
|
||||
"nodes": Array [
|
||||
Object {
|
||||
"data": undefined,
|
||||
"kind": "text",
|
||||
"text": "blue moon",
|
||||
},
|
||||
Object {
|
||||
"data": undefined,
|
||||
"kind": "text",
|
||||
"text": "
|
||||
",
|
||||
},
|
||||
Object {
|
||||
"data": undefined,
|
||||
"kind": "text",
|
||||
"text": "footballs",
|
||||
},
|
||||
],
|
||||
"type": "paragraph",
|
||||
},
|
||||
],
|
||||
"type": "root",
|
||||
}
|
||||
`;
|
||||
|
@ -46,7 +46,7 @@ const testPlugins = fromJS([
|
||||
|
||||
const parser = markdown => remarkToSlate(markdownToRemark(markdown));
|
||||
|
||||
describe("Compile markdown to Prosemirror document structure", () => {
|
||||
describe("Compile markdown to Slate Raw AST", () => {
|
||||
it("should compile simple markdown", () => {
|
||||
const value = `
|
||||
# H1
|
||||
@ -111,7 +111,7 @@ blue moon
|
||||
expect(parser(value)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should compile hard breaks (double space)", () => {
|
||||
it("should compile soft breaks (double space)", () => {
|
||||
const value = `
|
||||
blue moon
|
||||
footballs
|
||||
|
Loading…
x
Reference in New Issue
Block a user