mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Fix lang frontend test to 'waitFor' the 'localized' event
This commit is contained in:
parent
f20af4818c
commit
c1f9028d19
1 changed files with 12 additions and 14 deletions
|
@ -21,14 +21,13 @@ describe("Language select and change", function(){
|
||||||
$languageoption.attr('selected','selected');
|
$languageoption.attr('selected','selected');
|
||||||
$language.change();
|
$language.change();
|
||||||
|
|
||||||
helper.waitFor(function(){
|
var localizedEventFired = false;
|
||||||
|
$(chrome$.window).bind('localized', function() {
|
||||||
var $boldButton = chrome$(".buttonicon-bold").parent();
|
localizedEventFired = true;
|
||||||
//get the title of the bold button
|
})
|
||||||
var boldButtonTitle = $boldButton[0]["title"];
|
|
||||||
return boldButtonTitle !== undefined;
|
|
||||||
}).done(function(){
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ 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();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,13 +56,13 @@ describe("Language select and change", function(){
|
||||||
$languageoption.attr('selected','selected');
|
$languageoption.attr('selected','selected');
|
||||||
$language.change();
|
$language.change();
|
||||||
|
|
||||||
helper.waitFor(function(){
|
var localizedEventFired = false;
|
||||||
|
$(chrome$.window).bind('localized', function() {
|
||||||
|
localizedEventFired = true;
|
||||||
|
})
|
||||||
|
|
||||||
var $boldButton = chrome$(".buttonicon-bold").parent();
|
helper.waitFor(function() { return localizedEventFired;})
|
||||||
//get the title of the bold button
|
.done(function(){
|
||||||
var boldButtonTitle = $boldButton[0]["title"];
|
|
||||||
return boldButtonTitle !== undefined;
|
|
||||||
}).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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue