a script for testing font change

This commit is contained in:
johnyma22 2012-10-04 20:44:21 +01:00
parent fa9c5531e9
commit 7f819967f9

View file

@ -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;");
});
});