snapscreen.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Created by JetBrains PhpStorm.
  3. * User: dongyancen
  4. * Date: 12-9-17
  5. * Time: 下午2:38
  6. * To change this template use File | Settings | File Templates.
  7. */
  8. module('plugins.snapscreen');
  9. test('检查高亮', function () {
  10. var editor = te.obj[0];
  11. editor.focus();
  12. equal(editor.queryCommandState('snapscreen'), 0, 'check snapscreen state');
  13. });
  14. test('snapscreen', function () {
  15. var div = document.body.appendChild(document.createElement('script'));
  16. div.id = 'ue';
  17. var editor = UE.getEditor('ue');
  18. stop();
  19. editor.ready(function () {
  20. setTimeout(function () {
  21. editor.execCommand('snapscreen');
  22. editor.container.removeChild(editor.container.lastChild);
  23. setTimeout(function () {
  24. ok($('.edui-dialog .edui-for-snapscreen')[0] != null, '');
  25. $EDITORUI[$('.edui-dialog .edui-for-snapscreen')[0].parentNode.id].close();
  26. setTimeout(function () {
  27. UE.delEditor('ue');
  28. te.dom.push(document.getElementById('ue'));
  29. start();
  30. }, 1000);
  31. }, 300);
  32. }, 100);
  33. }
  34. );
  35. });