import slate from '../index'; import { HtmlToSlate } from '../htmlToSlate'; import defaultPlugins from '../plugins'; import makeSlatePluginsFromDef from '../utils/makeSlatePluginsFromDef'; const htmlToSlate = HtmlToSlate({ plugins: makeSlatePluginsFromDef(defaultPlugins), }); describe('getTextContents', () => { const mySlate = slate(); it('serializes a slate to raw text', async () => { // we use `htmlToSlate` to generate simple values const data = await htmlToSlate( `
How are you?
` ); const contents = mySlate.getTextContents(data); expect(contents).toEqual(['Hello World!', 'How are you?']); }); it('handles inline blocks correctly', async () => { // we use `htmlToSlate` to generate simple values const data = await htmlToSlate( `How are you?
` ); const contents = mySlate.getTextContents(data); expect(contents).toEqual(['Hello World!', 'How are you?']); }); it('handles lists correctly', async () => { // we use `htmlToSlate` to generate simple values const data = await htmlToSlate( `