Bug 658450 - Remove flaky tests from Scriptaculous ajax_inplaceeditor_test.html; r=ehsan

This commit is contained in:
Justin Lebar 2011-05-27 18:32:11 -04:00
Родитель e93a9c8549
Коммит 070d759ab7
1 изменённых файлов: 1 добавлений и 66 удалений

Просмотреть файл

@ -43,71 +43,6 @@
inPlaceEditor.dispose();
}},
// Integration test, tests the entire cycle
testInPlaceEditor: function() { with(this) {
Event.simulateMouse('tobeedited','click');
assertHidden($('tobeedited'));
assertNotNull(document.forms[0]);
assertEqual("cancel", document.forms[0].lastChild.innerHTML);
assertVisible(document.forms[0]);
Event.simulateMouse(document.forms[0].lastChild,'click');
assertNull(document.forms[0]);
assertVisible($('tobeedited'));
assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
Event.simulateMouse('tobeedited','mouseover');
Event.simulateMouse('tobeedited','click');
assertEqual("INPUT", document.forms[0].firstChild.tagName);
assertEqual("To be edited", document.forms[0].firstChild.value);
assertEqual("INPUT", document.forms[0].childNodes[1].tagName);
assertEqual("submit", document.forms[0].childNodes[1].type);
assertEqual("To be edited", document.forms[0].firstChild.value);
assert(Element.hasClassName(document.forms[0], 'inplaceeditor-form'),
"form doesn't have proper class: " + document.forms[0].className);
Event.simulateMouse(document.forms[0].childNodes[1],'click');
assertVisible($('tobeedited'));
assertEqual("Saving...", $('tobeedited').innerHTML);
assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
assert(Element.hasClassName($('tobeedited'), 'inplaceeditor-saving'),
"doesn't have saving class");
wait(1000, function() {
assertEqual("Server received: To be edited", $('tobeedited').innerHTML);
assertNull(document.forms[0]);
assertVisible($('tobeedited'));
assert(!Element.hasClassName($('tobeedited'), 'inplaceeditor-saving'));
});
}},
testHovering: function() { with(this) {
Event.simulateMouse('tobeedited','mouseover');
assertEqual("rgb(255, 255, 153)", Element.getStyle('tobeedited','background-color'));
Event.simulateMouse('tobeedited','mouseout');
wait(1100, function() {
assertEqual("transparent", Element.getStyle('tobeedited','background-color'),
"should be transparent after mouse leaves element");
Event.simulateMouse('tobeedited','click');
})
}},
testLoadsTextFromServer: function() { with(this) {
inPlaceEditor.options.loadTextURL = '_ajax_inplaceeditor_text.html';
inPlaceEditor.enterEditMode();
assertEqual('Loading...', inPlaceEditor.form.value.value);
assert(inPlaceEditor.form.value.disabled);
assert(Element.hasClassName(inPlaceEditor.form, 'inplaceeditor-loading'));
wait(1000, function() {
assertEqual('Text from server', inPlaceEditor.form.value.value);
assert(!inPlaceEditor.form.value.disabled);
});
}},
testDisposesProperly: function() { with(this) {
assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
inPlaceEditor.dispose();
@ -214,4 +149,4 @@
// ]]>
</script>
</body>
</html>
</html>