Fix lang frontend test to 'waitFor' the 'localized' event

This commit is contained in:
Marcel Klehr 2012-11-18 20:11:16 +01:00
parent f20af4818c
commit c1f9028d19
1 changed files with 12 additions and 14 deletions

View File

@ -21,14 +21,13 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected');
$language.change();
helper.waitFor(function(){
var $boldButton = chrome$(".buttonicon-bold").parent();
//get the title of the bold button
var boldButtonTitle = $boldButton[0]["title"];
return boldButtonTitle !== undefined;
}).done(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
var $boldButton = chrome$(".buttonicon-bold").parent();
@ -38,7 +37,6 @@ describe("Language select and change", function(){
//check if the language is now german
expect(boldButtonTitle).to.be("Fett (Strg-B)");
done();
});
});
@ -58,13 +56,13 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected');
$language.change();
helper.waitFor(function(){
var localizedEventFired = false;
$(chrome$.window).bind('localized', function() {
localizedEventFired = true;
})
var $boldButton = chrome$(".buttonicon-bold").parent();
//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
var $boldButton = chrome$(".buttonicon-bold").parent();