Skip to content

Commit

Permalink
show a failing context
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaanj committed Dec 27, 2023
1 parent 7af5306 commit 9fcdc22
Showing 1 changed file with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
import { createTodoListPlugin } from '@udecode/plate-list';
import {
createListPlugin,
createTodoListPlugin,
ELEMENT_LI,
ELEMENT_LIC,
ELEMENT_UL,
} from '@udecode/plate-list';
import { createPlateUIEditor } from 'www/src/lib/plate/create-plate-ui-editor';

import { serializeHtml } from '../../serializeHtml';

it('serialize elements using useSlateStatic', () => {
const plugins = [createTodoListPlugin()];
const plugins = [
createTodoListPlugin(),
createListPlugin({
overrideByKey: {
[ELEMENT_UL]: {
type: 'unordered-list',
},
[ELEMENT_LI]: {
type: 'list-item',
},
[ELEMENT_LIC]: {
type: 'list-item-child',
},
},
}),
];
const editor = createPlateUIEditor({ plugins });
const render = serializeHtml(editor, {
nodes: [
Expand All @@ -13,6 +34,20 @@ it('serialize elements using useSlateStatic', () => {
checked: true,
children: [{ text: 'Slide to the right.' }],
},
{
type: 'unordered-list',
children: [
{
type: 'list-item',
children: [
{
type: 'list-item-child',
children: [{ text: 'Level 3' }],
},
],
},
],
},
],
});

Expand Down

0 comments on commit 9fcdc22

Please sign in to comment.