How to use the jest-prosemirror.h1 function in jest-prosemirror

To help you get started, we’ve selected a few jest-prosemirror examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / command-utils.spec.ts View on Github external
it('removes the toggled type', () => {
    const from = doc(h1('toggled'));
    const to = doc(p('toggled'));
    expect(
      toggleBlockItem({
        type: schema.nodes.heading,
        toggleType: schema.nodes.paragraph,
        attrs: { level: 1 },
      }),
    ).toTransformNode({
      from,
      to,
    });
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / command-utils.spec.ts View on Github external
it('toggles to the specified type', () => {
    const from = doc(p('toggled'));
    const to = doc(h1('toggled'));
    expect(
      toggleBlockItem({
        type: schema.nodes.heading,
        toggleType: schema.nodes.paragraph,
        attrs: { level: 1 },
      }),
    ).toTransformNode({
      from,
      to,
    });
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / command-utils.spec.ts View on Github external
it('can specify from and to', () => {
    const from = doc(p('Ignore'), '');
    const to = doc(p('Ignore'), h1('Content'));
    expect(
      replaceText({
        appendText: '',
        type: schema.nodes.heading,
        content: 'Content',
        range: { from: 8, to: 8 },
      }),
    ).toTransformNode({
      from,
      to,
    });
  });