Skip to content

Instantly share code, notes, and snippets.

@javierfernandes
Created August 17, 2020 14:25
Show Gist options
  • Select an option

  • Save javierfernandes/09016ef3d04d7606365c8f3a8f727a20 to your computer and use it in GitHub Desktop.

Select an option

Save javierfernandes/09016ef3d04d7606365c8f3a8f727a20 to your computer and use it in GitHub Desktop.
describe('isWholeBlockSelected()', () => {
[
['[>This is some text>]', true],
['T[>his is some text>]', false],
['[>This is some tex>]t', false],
['This is some text', false],
].forEach(([input, expected]) => {
it(`"${input}" = ${expected}`, () => {
const state = createState(input)
expect(isWholeBlockSelected(state.getCurrentContent(), state.getSelection()))
.toBe(expected)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment