some projects
', }, { i: { document: { nodes: [ { object: 'block', nodes: [ { object: 'text', leaves: [ { text: 'some ' }, { marks: [{ data: {}, type: 'EMPHASIZE/EM' }], text: 'projects', }, { text: '-' }, { marks: [{ data: {}, type: 'EMPHASIZE/STRONG' }], text: 'foo', }, ], }, ], type: 'PARAGRAPH/PARAGRAPH', }, ], }, }, o: 'some projects-foo
', }, { i: { document: { nodes: [ { object: 'block', type: 'CODE/CODE', nodes: [ { object: 'text', text: 'asdf', }, ], }, ], }, }, o: 'asdf',
// TODO this should not be skipped but it's a workaround for deserialization...
skip: true,
},
{
i: {
document: {
nodes: [
{
object: 'block',
type: 'PARAGRAPH/PARAGRAPH',
nodes: [
{
object: 'text',
leaves: [
{
text: 'a',
},
{
text: 'bc',
marks: [
{
type: 'CODE/CODE',
},
],
},
{
text: 'de',
},
],
},
],
},
],
},
},
o: 'abcde
asdfgh', skip: true, }, { i: { document: { nodes: [ { object: 'block', type: 'PARAGRAPH/PARAGRAPH', nodes: [{ object: 'text', text: 'ab' }], data: { align: 'center' }, }, ], }, }, o: '
ab
', skip: true, }, { i: { document: { nodes: [ { object: 'block', type: 'BLOCKQUOTE/BLOCKQUOTE', nodes: [{ object: 'text', text: 'ab\nde' }], }, ], }, }, o: 'ab', // skip: true }, ].forEach((c, k) => { describe(`test case ${k}`, () => { it('should serialize properly', () => { // tslint:disable-next-line:no-any expect(html.serialize(Value.fromJSON(c.i as any))).toEqual(c.o); }); it(`should deserialize properly: ${c.o}`, () => { if (c.skip) { return; } expect(Plain.serialize(html.deserialize(c.o))).toEqual( // tslint:disable-next-line:no-any Plain.serialize(Value.fromJSON(c.i as any)) ); }); }); }); });
de