From 7f819967f9b57a267bd05986e35c3902e36027ad Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Thu, 4 Oct 2012 20:44:21 +0100 Subject: a script for testing font change --- tests/frontend/specs/font_type.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/frontend/specs/font_type.js (limited to 'tests') 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;"); + }); +}); -- cgit v1.2.3