Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('returns false when selection is active', () => {
const {
state: { selection },
} = createEditor(doc(p('inline'), p('aba', 'awesome')));
expect(selectionEmpty(selection)).toBeFalse();
});
it('should return false for ambiguous locations', () => {
const { state } = createEditor(doc(p('Something this is a word')));
expect(getSelectedWord(state)).toBeFalse();
});
it('returns true for full selection', () => {
const { state } = createEditor(doc(p('Something')));
expect(atDocStart(state)).toBeTrue();
});
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')));
});
});
it('returns false when no selection', () => {
const { state } = createEditor(doc(p('Something')));
expect(atDocEnd(state)).toBeFalse();
});
.callback(content => {
expect(content.state.doc).toEqualProsemirrorNode(doc(p('@awesome')));
});
});