mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
the monospace test works now
This commit is contained in:
parent
a4d68b2b25
commit
bd47b6c40b
2 changed files with 19 additions and 35 deletions
|
@ -19,18 +19,17 @@
|
||||||
<script src="lib/jquery.iframe.js"></script>
|
<script src="lib/jquery.iframe.js"></script>
|
||||||
|
|
||||||
<script src="specs/helper.js"></script>
|
<script src="specs/helper.js"></script>
|
||||||
|
|
||||||
<script src="specs/button_bold.js"></script>
|
<script src="specs/button_bold.js"></script>
|
||||||
<script src="specs/button_italic.js"></script>
|
<script src="specs/button_italic.js"></script>
|
||||||
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
||||||
<script src="specs/keystroke_delete.js"></script>
|
<script src="specs/keystroke_delete.js"></script>
|
||||||
|
<script src="specs/font_type.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<script src="specs/button_indentation.js"></script>
|
<script src="specs/button_indentation.js"></script>
|
||||||
|
|
||||||
<script src="specs/font_type.js"></script>
|
<script src="specs/font_type.js"></script>
|
||||||
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
|
||||||
<script src="specs/button_bold.js"></script>
|
|
||||||
<script src="specs/button_italic.js"></script>
|
|
||||||
<script src="specs/keystroke_delete.js"></script>
|
|
||||||
<script src="specs/embed_value.js"></script>-->
|
<script src="specs/embed_value.js"></script>-->
|
||||||
|
|
||||||
<script src="runner.js"></script>
|
<script src="runner.js"></script>
|
||||||
|
|
|
@ -1,45 +1,30 @@
|
||||||
describe("font select", function(){
|
describe("font select", function(){
|
||||||
//create a new pad before each test run
|
//create a new pad before each test run
|
||||||
beforeEach(function(cb){
|
beforeEach(function(cb){
|
||||||
testHelper.newPad(cb);
|
helper.newPad(cb);
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text monospace", function() {
|
it("makes text monospace", function(done) {
|
||||||
//get the inner iframe
|
var inner$ = helper.padInner$;
|
||||||
var $inner = testHelper.$getPadInner();
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//open pad settings
|
//click on the settings button to make settings visible
|
||||||
var $settingsButton = testHelper.$getPadChrome().find(".buttonicon-settings");
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
$settingsButton.click();
|
$settingsButton.click();
|
||||||
|
|
||||||
//get the font selector and click it
|
//get the font menu and monospace option
|
||||||
var $viewfontmenu = testHelper.$getPadChrome().find("#viewfontmenu");
|
var $viewfontmenu = chrome$("#viewfontmenu");
|
||||||
$viewfontmenu.click();
|
var $monospaceoption = $viewfontmenu.find("[value=monospace]");
|
||||||
|
|
||||||
//get the monospace option and click it
|
//select monospace and fire change event
|
||||||
var $monospaceoption = testHelper.$getPadChrome().find("[value=monospace]");
|
|
||||||
$monospaceoption.attr('selected','selected');
|
$monospaceoption.attr('selected','selected');
|
||||||
|
$viewfontmenu.change();
|
||||||
|
|
||||||
/*
|
//check if font changed to monospace
|
||||||
|
var fontFamily = inner$("body").css("font-family").toLowerCase();
|
||||||
|
expect(fontFamily).to.be("monospace");
|
||||||
|
|
||||||
//get the font selector and click it
|
done();
|
||||||
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;");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue