Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. function SetupHaltSpies( event ) {
  2. sinon.spy( event, "preventDefault" );
  3. sinon.spy( event, "stopPropagation" );
  4. };
  5.  
  6. function AssertHaltEvent( assert, event ) {
  7. assert.ok( event.preventDefault.called, "the preventDefault method was not called for the " + event.name + "event");
  8. assert.ok( event.stopPropagation.called, "the stopPropagation method was not called for the " + event.name + "event");
  9. };
  10.  
  11. function AssertHaltEventNotCalled( assert, event ) {
  12. assert.ok( event.preventDefault.notCalled, "the preventDefault method was called for the " + event.name + "event");
  13. assert.ok( event.stopPropagation.notCalled, "the stopPropagation method was called for the " + event.name + "event");
  14. };
  15.  
  16. function CreateEditor( options ) {
  17.  
  18. var editor = $("<div></div>").attr( "contenteditable", true );
  19. var wysiwyg = new window.Wysiwyg( editor, options );
  20.  
  21. // This is required so that the editor is :visible
  22. editor.appendTo( document.body );
  23.  
  24. return wysiwyg;
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement