/** @jsx jsx */
import { jsx } from '../../../../__fixtures__/hyperscript';
import { getSelectionText } from './getSelectionText';
describe('getSelectionText', () => {
it('collapsed, should w/o text', () => {
const input = (
foo
) as any;
expect(getSelectionText(input)).toBe('');
});
it('expanded, in single block', () => {
const input = (
foo
) as any;
expect(getSelectionText(input)).toBe('foo');
});
it('expanded, across blocks', () => {
const input = (
f
oo
b
ar
) as any;
expect(getSelectionText(input)).toBe('oob');
});
it('expanded, across blocks w/ hanging range', () => {
const input = (
f
oo
bar
) as any;
expect(getSelectionText(input)).toBe('oo');
});
});