etherpad-lite/tests/frontend/specs/font_type.js

33 lines
982 B
JavaScript
Raw Normal View History

2012-10-04 21:44:21 +02:00
describe("font select", function(){
//create a new pad before each test run
beforeEach(function(cb){
2012-10-08 14:13:35 +02:00
helper.newPad(cb);
2012-11-02 00:19:59 +01:00
this.timeout(60000);
2012-10-04 21:44:21 +02:00
});
2012-10-08 14:13:35 +02:00
it("makes text monospace", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
2012-10-04 21:44:21 +02:00
2012-10-08 14:13:35 +02:00
//click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings");
2012-10-04 21:44:21 +02:00
$settingsButton.click();
2012-10-08 14:13:35 +02:00
//get the font menu and monospace option
var $viewfontmenu = chrome$("#viewfontmenu");
var $monospaceoption = $viewfontmenu.find("[value=monospace]");
2012-10-08 14:13:35 +02:00
//select monospace and fire change event
$monospaceoption.attr('selected','selected');
2013-03-02 00:40:25 +01:00
$viewfontmenu.val("monospace");
2013-03-02 00:33:24 +01:00
$viewfontmenu.change();
2012-10-08 14:13:35 +02:00
//check if font changed to monospace
var fontFamily = inner$("body").css("font-family").toLowerCase();
2015-07-01 21:23:31 +02:00
var containsStr = fontFamily.indexOf("monospace");
2015-04-11 01:23:06 +02:00
expect(containsStr).to.not.be(-1);
2012-10-08 14:13:35 +02:00
done();
2012-10-04 21:44:21 +02:00
});
});