indent.js 971 B

1234567891011121314151617181920212223242526272829303132
  1. import Delta from 'quill-delta';
  2. import Editor from '../../../core/editor';
  3. describe('Indent', function() {
  4. it('+1', function() {
  5. const editor = this.initialize(
  6. Editor,
  7. '<ol><li data-list="bullet">0123</li></ol>',
  8. );
  9. editor.formatText(4, 1, { indent: '+1' });
  10. expect(editor.getDelta()).toEqual(
  11. new Delta().insert('0123').insert('\n', { list: 'bullet', indent: 1 }),
  12. );
  13. expect(editor.scroll.domNode).toEqualHTML(
  14. '<ol><li data-list="bullet" class="ql-indent-1">0123</li></ol>',
  15. );
  16. });
  17. it('-1', function() {
  18. const editor = this.initialize(
  19. Editor,
  20. '<ol><li data-list="bullet" class="ql-indent-1">0123</li></ol>',
  21. );
  22. editor.formatText(4, 1, { indent: '-1' });
  23. expect(editor.getDelta()).toEqual(
  24. new Delta().insert('0123').insert('\n', { list: 'bullet' }),
  25. );
  26. expect(editor.scroll.domNode).toEqualHTML(
  27. '<ol><li data-list="bullet">0123</li></ol>',
  28. );
  29. });
  30. });