mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
change language test -- note i didnt include test for cookie persistance
This commit is contained in:
parent
6de7634357
commit
3830c878d2
1 changed files with 83 additions and 0 deletions
83
tests/frontend/specs/language.js
Normal file
83
tests/frontend/specs/language.js
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
describe("Language select and change", function(){
|
||||||
|
//create a new pad before each test run
|
||||||
|
beforeEach(function(cb){
|
||||||
|
helper.newPad(cb);
|
||||||
|
this.timeout(60000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("makes text german", function(done) {
|
||||||
|
var inner$ = helper.padInner$;
|
||||||
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
|
//click on the settings button to make settings visible
|
||||||
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
|
$settingsButton.click();
|
||||||
|
|
||||||
|
//click the language button
|
||||||
|
var $language = chrome$("#languagemenu");
|
||||||
|
var $languageoption = $language.find("[value=de]");
|
||||||
|
|
||||||
|
//select german
|
||||||
|
$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(){
|
||||||
|
|
||||||
|
//get the value of the bold button
|
||||||
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
||||||
|
|
||||||
|
//get the title of the bold button
|
||||||
|
var boldButtonTitle = $boldButton[0]["title"];
|
||||||
|
|
||||||
|
//check if the language is now german
|
||||||
|
expect(boldButtonTitle).to.be("Fett (Strg-B)");
|
||||||
|
done();
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("makes text English", function(done) {
|
||||||
|
var inner$ = helper.padInner$;
|
||||||
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
|
//click on the settings button to make settings visible
|
||||||
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
|
$settingsButton.click();
|
||||||
|
|
||||||
|
//click the language button
|
||||||
|
var $language = chrome$("#languagemenu");
|
||||||
|
var $languageoption = $language.find("[value=en]");
|
||||||
|
|
||||||
|
//select german
|
||||||
|
$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(){
|
||||||
|
|
||||||
|
//get the value of the bold button
|
||||||
|
var $boldButton = chrome$(".buttonicon-bold").parent();
|
||||||
|
|
||||||
|
//get the title of the bold button
|
||||||
|
var boldButtonTitle = $boldButton[0]["title"];
|
||||||
|
|
||||||
|
//check if the language is now English
|
||||||
|
expect(boldButtonTitle).to.be("Bold (Ctrl-B)");
|
||||||
|
done();
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue