editor-toolbar-selection.test.js 358 B

12345678910111213
  1. const assert = require('assert')
  2. const fs = require('fs')
  3. const source = fs.readFileSync(
  4. require('path').resolve(__dirname, '../src/components/editor/index.vue'),
  5. 'utf8'
  6. )
  7. assert.match(
  8. source,
  9. /onCreated\s*:\s*\(editor\)\s*=>\s*\{\s*editor\.focus\(\)/,
  10. 'editor must initialize a Slate selection after creation so toolbar buttons are enabled'
  11. )