it('must ignore an entity that is entirely within the selection', () => {
        var block = contentState.getBlockForKey('b');

        // Remove entity from beginning and end of block.
        var newBlock = applyEntityToContentBlock(block, 0, 1, null);
        newBlock = applyEntityToContentBlock(newBlock, 4, 5, null);

        var newBlockMap = contentState.getBlockMap().set('b', newBlock);
        var newContent = contentState.set('blockMap', newBlockMap);
        var selection = selectionOnEntity.merge({
          anchorOffset: 0,
          focusOffset: 5,
        });
        var result = removeEntitiesAtEdges(newContent, selection);
        expectSameBlockMap(newContent, result);
      });
 .map((block, blockKey) => {
   const sliceStart = blockKey === startKey ? startOffset : 0;
   const sliceEnd = blockKey === endKey ? endOffset : block.getLength();
   return applyEntityToContentBlock(
     block,
     sliceStart,
     sliceEnd,
     entityKey,
   );
 });
const assertApplyEntityToContentBlock = (
  start,
  end,
  entityKey = 'x',
  contentBlock = sampleBlock,
) => {
  expect(
    applyEntityToContentBlock(contentBlock, start, end, entityKey).toJS(),
  ).toMatchSnapshot();
};
 it('must remove for non-collapsed cursor on multiple entities', () => {
   var block = contentState.getBlockForKey('b');
   var newBlock = applyEntityToContentBlock(block, 3, 5, '456');
   var newBlockMap = contentState.getBlockMap().set('b', newBlock);
   var newContent = contentState.set('blockMap', newBlockMap);
   var selection = selectionOnEntity.merge({
     anchorOffset: 1,
     focusOffset: 4,
   });
   var result = removeEntitiesAtEdges(newContent, selection);
   expectNullEntities(result.getBlockForKey('b'));
 });
 it('must remove entities at both ends of selection', () => {
   var cBlock = contentState.getBlockForKey('c');
   var len = cBlock.getLength();
   var modifiedC = applyEntityToContentBlock(cBlock, 0, len, '456');
   var newBlockMap = contentState.getBlockMap().set('c', modifiedC);
   var newContent = contentState.set('blockMap', newBlockMap);
   var selection = selectionState.merge({
     anchorKey: 'b',
     anchorOffset: 3,
     focusKey: 'c',
     focusOffset: 3,
   });
   var result = removeEntitiesAtEdges(newContent, selection);
   expectNullEntities(result.getBlockForKey('b'));
   expectNullEntities(result.getBlockForKey('c'));
 });
 it('must apply to the entire text', () => {
   var modified = applyEntityToContentBlock(block, 0, 5, 'x');
   expect(getEntities(modified)).toEqual(['x', 'x', 'x', 'x', 'x']);
 });
 it('must apply at the end', () => {
   var modified = applyEntityToContentBlock(block, 3, 5, 'x');
   expect(getEntities(modified)).toEqual([null, null, null, 'x', 'x']);
 });
 it('must apply within', () => {
   var modified = applyEntityToContentBlock(block, 1, 4, 'x');
   expect(getEntities(modified)).toEqual([null, 'x', 'x', 'x', null]);
 });
 it('must apply from the start', () => {
   var modified = applyEntityToContentBlock(block, 0, 2, 'x');
   expect(getEntities(modified)).toEqual(['x', 'x', null, null, null]);
 });