editor.js revision 3d106ceb5a28fc4b4a4bdd5885d06dd79ab385db
var editor = null,
iframe = null,
});
});
});
},
template = {
name: 'Editor Tests',
setUp : function() {
},
tearDown : function() {
},
test_load: function() {
},
test_frame: function() {
var iframeReady = false;
container: '#editor',
designMode: true,
content: 'This is a test.',
});
iframeReady = true;
});
this.wait(function() {
}, 1500);
},
test_frame_use: function() {
test = this;
});
});
},
test_frame_general: function() {
var e = Y.one('#editor iframe');
},
'test: _DOMPaste': function() {
var OT = 'ORIGINAL_TARGET',
fired = false;
getData: function() {
return 'foobar'
}
}
};
fired = true;
});
_event: {
getData: function() {
return 'foobar'
}
}
}
});
},
test_frame_destroy: function() {
},
test_editor: function() {
var iframeReady = false;
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
iframeReady = true;
});
var events = {
'execcommand': true,
'paste': true,
'mouseup': true,
'mousedown': true,
'keydown': true,
'keyup': true,
'keypress': true,
'enter': true,
'enter-up': true,
'enter-down': true,
'enter-press': true
};
if (e.changedType !== 'execcommand') {
}
});
this.wait(function() {
Y.Assert.areSame(Y.EditorBase.FILTER_RGB(inst.one('b').getStyle('color')), '#ff0000', 'Extra CSS Failed');
pageX: 100,
pageY: 100
});
}, 1500);
},
test_copy_styles: function() {
Y.Assert.areSame(node.one('div').getStyle('color'), node2.getStyle('color'), 'Style failed to copy');
Y.Assert.areSame(node.one('div').getStyle('fontFamily'), node2.getStyle('fontFamily'), 'Style failed to copy');
},
test_resolve_node: function() {
},
test_get_content: function() {
}
Y.Assert.areEqual(ex + 'Hello <b>World</b>!!'.toLowerCase(), html.toLowerCase(), 'getContent failed to get the editor content');
},
test_font_size_normalize: function() {
}
},
test_selection_font_removal: function() {
//IE 6 doesn't like the getAttribute('style') call, it returns an object
Y.Assert.isTrue((node.getAttribute('style').indexOf('foo: bar') > -1), 'Failed to remove font-family ;');
Y.Assert.isTrue((node.getAttribute('style').indexOf('font-family') === -1), 'Failed to remove font-family ;');
}
},
test_gettext: function() {
},
test_selection_general: function() {
},
test_selection_methods: function() {
Y.Assert.isTrue(editor.getContent().indexOf('This is another test') > -1, 'Failed to insert content');
},
'test: EditorSelection': function() {
html = '<b>Foobar</b>',
var a = sel.anchorNode;
//sel.remove();
sel.anchorNode = a;
},
test_execCommands: function() {
/*
No Asserts here yet, this test is only to
show that there are no syntax errors thrown running
an execCommand.
I still need to develop a way to properly test these commands
*/
if (cmd !== 'bidi') {
}
});
}
});
inst.EditorSelection = function() {
sel.isCollapsed = false;
return sel;
};
for (var i in SEL) {
}
},
test_window: function() {
Y.Assert.areEqual(Y.Node.getDOMNode(Y.one('#editor iframe').get('contentWindow')), Y.Node.getDOMNode(editor.getInstance().one('win')), 'Window object is not right');
},
test_doc: function() {
Y.Assert.areEqual(Y.Node.getDOMNode(Y.one('#editor iframe').get('contentWindow.document')), Y.Node.getDOMNode(editor.getInstance().one('doc')), 'Document object is not right');
},
'test: selection.remove()': function() {
},
test_destroy: function() {
},
test_br_plugin: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
},
test_para_plugin: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
var str = '<b>foo</b>';
changedEvent: {},
changedType: 'enter-up'
});
changedEvent: {},
changedType: 'enter'
});
},
test_double_plug_setup: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
},
test_double_plug: function() {
//This should error
},
test_double_down: function() {
},
test_double_plug_setup2: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
},
test_double_plug2: function() {
//This should error
},
test_double_down2: function() {
},
test_bidi_noplug: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
this.wait(function() {
//This should error
}, 1500);
},
test_bidi_plug: function() {
editor = new Y.EditorBase({
content: 'Hello <b>World</b>!!',
extracss: 'b { color: red; }'
});
sel.selectNode(b, true, true);
sel.selectNode(b, true, true);
sel.selectNode(b, true, true);
changedType: 'end-up'
});
},
_should: {
fail: {
},
error: { //These tests should error
test_double_plug: true,
test_double_plug2: true,
test_bidi_noplug: true
}
}
};
});