editor.js revision 84e4fc4350d23a4c37b8d6a3f5ee4c131cacf5dd
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_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
});
keyCode: 13
});
keyCode: 13
});
keyCode: 13
});
}, 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() {
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_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_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; }'
});
},
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() {
sel.selectNode(b, true, true);
sel.selectNode(b, true, true);
sel.selectNode(b, true, true);
});
},
_should: {
fail: {
},
error: { //These tests should error
test_double_plug: true,
test_double_plug2: true,
test_bidi_noplug: true
}
}
};
});