How to use the jest-prosemirror.em 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__ / dom-utils.spec.ts View on Github external
it('returns false when not within an active region', () => {
    const { state, schema } = createEditor(doc(p('Something', em('is italic'), ' here')));
    expect(isMarkActive({ state, type: schema.marks.em })).toBeFalse();
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('returns an empty object when mark not found', () => {
    const { state, schema } = createEditor(doc(p('a link', em('linked here'))));
    expect(getMarkAttrs(state, schema.marks.link)).toEqual({});
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('is false when from and to specified in empty node', () => {
    const { state, schema } = createEditor(doc(p(em('is italic')), p('')));
    expect(isMarkActive({ state, type: schema.marks.em, from: 11, to: 20 })).toBeFalse();
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('returns false with no selection', () => {
    const { state, schema } = createEditor(doc(p(' ', em('italic'))));
    expect(isMarkActive({ state, type: schema.marks.em })).toBeFalse();
  });
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('only returns true when $pos starts within mark', () => {
    const { state, schema } = createEditor(doc(p('Something', em('is italic'))));
    expect(getMarkRange(state.selection.$from, schema.marks.em)).toBeFalse();
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('returns false for non-prosemirror nodes', () => {
    expect(isProsemirrorNode(em())).toBeFalse();
  });
});
github ifiokjr / remirror / @remirror / core-utils / src / __tests__ / dom-utils.spec.ts View on Github external
it('shows active when within an active region', () => {
    const { state, schema } = createEditor(doc(p('Something', em('is italic'), ' here')));
    expect(isMarkActive({ state, type: schema.marks.em })).toBeTrue();
  });