From f830602cb2414e6be3f682205fde8fe4cb289aeb Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 23 Dec 2012 17:07:26 +0100 Subject: [PATCH] Add rtl frontend test --- tests/frontend/specs/language.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/frontend/specs/language.js b/tests/frontend/specs/language.js index 7d294282c..e7705914e 100644 --- a/tests/frontend/specs/language.js +++ b/tests/frontend/specs/language.js @@ -31,7 +31,7 @@ describe("Language select and change", function(){ $language.change(); helper.waitFor(function() { - return chrome$(".buttonicon-bold").parent()[0]["title"] = "Fett (Strg-B)"; + return chrome$(".buttonicon-bold").parent()[0]["title"] == "Fett (Strg-B)"; }) .done(function(){ //get the value of the bold button @@ -80,5 +80,31 @@ describe("Language select and change", function(){ }); }); + + it("changes direction when picking an rtl lang", 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=ar]"); + + //select arabic + $languageoption.attr('selected','selected'); + $language.change(); + + helper.waitFor(function() { + return chrome$("html")[0]["dir"] != 'ltr'; + }) + .done(function(){ + // check if the document's direction was changed + expect(chrome$("html")[0]["dir"]).to.be("rtl"); + done(); + }); + }); });