UNPKG

slate-edit-list

Version:

A Slate plugin to handle keyboard events in lists.

11 lines (7 loc) 327 B
const expect = require('expect'); module.exports = function(plugin, state) { const selectedBlock = state.document.getDescendant('cursor'); state = state.transform().moveToRangeOf(selectedBlock).apply(); const currentItem = plugin.utils.getCurrentItem(state); expect(currentItem.key).toBe('current_item'); };