How to use the jest-prosemirror.p 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__ / prosemirror-utils.spec.ts View on Github external
it('returns false when selection is active', () => {
    const {
      state: { selection },
    } = createEditor(doc(p('inline'), p('aba', 'awesome')));
    expect(selectionEmpty(selection)).toBeFalse();
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('should return false for ambiguous locations', () => {
    const { state } = createEditor(doc(p('Something this  is a word')));
    expect(getSelectedWord(state)).toBeFalse();
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('returns true for full selection', () => {
    const { state } = createEditor(doc(p('Something')));
    expect(atDocStart(state)).toBeTrue();
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / prosemirror-utils.spec.ts View on Github external
it('removes nested inline nodes at specified position', () => {
    const {
      state: { tr },
    } = createEditor(doc(p('one', atomInline())));
    const newTr = removeNodeAtPosition({ pos: 4, tr });
    expect(newTr).not.toBe(tr);
    expect(newTr.doc).toEqualProsemirrorNode(doc(p('one')));
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('returns false when no selection', () => {
    const { state } = createEditor(doc(p('Something')));
    expect(atDocEnd(state)).toBeFalse();
  });
github ifiokjr / remirror / packages / prosemirror-suggest / src / __tests__ / suggest-plugin.spec.ts View on Github external
.callback(content => {
        expect(content.state.doc).toEqualProsemirrorNode(doc(p('@awesome')));
      });
  });