mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Merge pull request #1181 from marcelklehr/fix/lang-test-dont-use-setimeout
dont use setimeout for lang tests
This commit is contained in:
commit
323517c6dc
1 changed files with 15 additions and 5 deletions
|
@ -21,8 +21,13 @@ describe("Language select and change", function(){
|
||||||
$languageoption.attr('selected','selected');
|
$languageoption.attr('selected','selected');
|
||||||
$language.change();
|
$language.change();
|
||||||
|
|
||||||
setTimeout(function(){
|
var localizedEventFired = false;
|
||||||
|
$(chrome$.window).bind('localized', function() {
|
||||||
|
localizedEventFired = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
helper.waitFor(function() { return localizedEventFired;})
|
||||||
|
.done(function(){
|
||||||
//get the value of the bold button
|
//get the value of the bold button
|
||||||
var $boldButton = chrome$(".buttonicon-bold").parent();
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
||||||
|
|
||||||
|
@ -32,8 +37,7 @@ describe("Language select and change", function(){
|
||||||
//check if the language is now german
|
//check if the language is now german
|
||||||
expect(boldButtonTitle).to.be("Fett (Strg-B)");
|
expect(boldButtonTitle).to.be("Fett (Strg-B)");
|
||||||
done();
|
done();
|
||||||
|
});
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text English", function(done) {
|
it("makes text English", function(done) {
|
||||||
|
@ -52,7 +56,13 @@ describe("Language select and change", function(){
|
||||||
$languageoption.attr('selected','selected');
|
$languageoption.attr('selected','selected');
|
||||||
$language.change();
|
$language.change();
|
||||||
|
|
||||||
setTimeout(function(){
|
var localizedEventFired = false;
|
||||||
|
$(chrome$.window).bind('localized', function() {
|
||||||
|
localizedEventFired = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
helper.waitFor(function() { return localizedEventFired;})
|
||||||
|
.done(function(){
|
||||||
|
|
||||||
//get the value of the bold button
|
//get the value of the bold button
|
||||||
var $boldButton = chrome$(".buttonicon-bold").parent();
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
||||||
|
@ -64,7 +74,7 @@ describe("Language select and change", function(){
|
||||||
expect(boldButtonTitle).to.be("Bold (Ctrl-B)");
|
expect(boldButtonTitle).to.be("Bold (Ctrl-B)");
|
||||||
done();
|
done();
|
||||||
|
|
||||||
}, 1000);
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue