fix failing bookmarklet specs (wait for js to finish)

This commit is contained in:
Florian Staudacher 2012-08-04 16:04:44 +02:00
parent 9d11748486
commit 932fb186e3
2 changed files with 15 additions and 9 deletions

View file

@ -24,6 +24,8 @@
window.setTimeout(window.close, 2000, true);
});
// this has to happen after the publisher has finished loading, otherwise
// the textarea is cleared again by the initialization of the mentions plugin
$(function(){
$("#publisher #status_message_fake_text").val(contents);
$("#publisher #status_message_text").val(contents);

View file

@ -22,14 +22,18 @@ describe("bookmarklet", function() {
describe("prefilled bookmarklet", function(){
it('fills in some text into the publisher', function(){
spec.loadFixture('prefilled_bookmarklet');
_.defer(function() {
expect($("#publisher #status_message_fake_text").val() == "").toBeFalsy();
expect($("#publisher #status_message_text").val() == "").toBeFalsy();
});
});
it('handles dirty input well', function(){
spec.loadFixture('prefilled_bookmarklet_dirty');
_.defer(function() {
expect($("#publisher #status_message_fake_text").val() == "").toBeFalsy();
expect($("#publisher #status_message_text").val() == "").toBeFalsy();
};
});
});