diff options
author | johnyma22 <john@mclear.co.uk> | 2012-10-04 20:44:21 +0100 |
---|---|---|
committer | johnyma22 <john@mclear.co.uk> | 2012-10-04 20:44:21 +0100 |
commit | 7f819967f9b57a267bd05986e35c3902e36027ad (patch) | |
tree | a03a45cebec441a5c173fe00d5adcbe579c75f82 /tests | |
parent | fa9c5531e9306a65f12d1dc121164fcf83dfde81 (diff) | |
download | etherpad-lite-7f819967f9b57a267bd05986e35c3902e36027ad.zip |
a script for testing font change
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/specs/font_type.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/frontend/specs/font_type.js b/tests/frontend/specs/font_type.js new file mode 100644 index 00000000..0314e03a --- /dev/null +++ b/tests/frontend/specs/font_type.js @@ -0,0 +1,32 @@ +describe("font select", function(){ + //create a new pad before each test run + beforeEach(function(cb){ + testHelper.newPad(cb); + }); + + it("makes text monospace", function() { + //get the inner iframe + var $inner = testHelper.$getPadInner(); + + //open pad settings + var $settingsButton = testHelper.$getPadChrome().find(".buttonicon-settings"); + $settingsButton.click(); + + //get the font selector and click it + var $viewfontmenu = testHelper.$getPadChrome().find("#viewfontmenu"); + $viewfontmenu.click(); // this doesnt work but I left it in for posterity. + $($viewfontmenu).attr('size',2); // this hack is required to make it visible ;\ + + //get the monospace option and click it + var $monospaceoption = testHelper.$getPadChrome().find("[value=monospace]"); + $monospaceoption.attr('selected','selected'); // despite this being selected the event doesnt fire + $monospaceoption.click(); // this doesnt work but it should. + + // get the attributes of the body of the editor iframe + var bodyAttr = $inner.find("body"); + var cssText = bodyAttr[0].style.cssText; + + //make sure the text hasn't changed + expect(cssText).to.eql("font-family: monospace;"); + }); +}); |