mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-15 11:36:53 -04:00
Added tests for author-colors (local+global), line-numbers (local+global), font (global)
This commit is contained in:
parent
48432d2b09
commit
c7b83928b0
3 changed files with 158 additions and 1 deletions
|
@ -5,7 +5,7 @@ describe("font select", function(){
|
|||
this.timeout(60000);
|
||||
});
|
||||
|
||||
it("makes text monospace", function(done) {
|
||||
it("makes text monospace locally", function(done) {
|
||||
var inner$ = helper.padInner$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -27,4 +27,29 @@ describe("font select", function(){
|
|||
|
||||
done();
|
||||
});
|
||||
|
||||
it("makes text monospace globally", function(done) {
|
||||
var inner$ = helper.padInner$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
//click on the settings button to make settings visible
|
||||
var $settingsButton = chrome$(".buttonicon-settings");
|
||||
$settingsButton.click();
|
||||
|
||||
//get the font menu and monospace option
|
||||
var $viewfontmenu = chrome$("#global-viewfontmenu");
|
||||
var $monospaceoption = $viewfontmenu.find("[value=monospace]");
|
||||
|
||||
//select monospace and fire change event
|
||||
$monospaceoption.attr('selected','selected');
|
||||
$viewfontmenu.change();
|
||||
|
||||
helper.waitFor(function(){
|
||||
return inner$("body").css("font-family").toLowerCase() == "monospace";
|
||||
}, 10000).always(function(){
|
||||
var newValue = inner$("body").css("font-family").toLowerCase();
|
||||
expect(newValue).to.be("monospace");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
66
tests/frontend/specs/hide_author_colors.js
Normal file
66
tests/frontend/specs/hide_author_colors.js
Normal file
|
@ -0,0 +1,66 @@
|
|||
describe("hiding author-colors", function(){
|
||||
//create a new pad before each test run
|
||||
beforeEach(function(cb){
|
||||
helper.newPad(cb);
|
||||
this.timeout(60000);
|
||||
});
|
||||
|
||||
it("hides the author-colors locally", function(done) {
|
||||
var inner$ = helper.padInner$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
//click on the settings button to make settings visible
|
||||
var $settingsButton = chrome$(".buttonicon-settings");
|
||||
$settingsButton.click();
|
||||
|
||||
//get the chat selector
|
||||
var $colorsCheckbox = chrome$("#options-colorscheck");
|
||||
|
||||
//get the current status of the author-colors
|
||||
var oldValue = inner$("body").hasClass("authorColors");
|
||||
|
||||
//select show author colors and fire change event
|
||||
$colorsCheckbox.attr('selected','selected');
|
||||
$colorsCheckbox.change();
|
||||
$colorsCheckbox.click();
|
||||
|
||||
//get the current status of the author-colors
|
||||
var newValue = inner$("body").hasClass("authorColors");
|
||||
|
||||
expect(oldValue).not.to.be(newValue);
|
||||
expect(newValue).to.be($colorsCheckbox.prop("checked"));
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it("hides the author-colors globally", function(done) {
|
||||
var inner$ = helper.padInner$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
this.timeout(10000);
|
||||
|
||||
//click on the settings button to make settings visible
|
||||
var $settingsButton = chrome$(".buttonicon-settings");
|
||||
$settingsButton.click();
|
||||
|
||||
//get the chat selector
|
||||
var $colorsCheckbox = chrome$("#options-global-colorscheck");
|
||||
|
||||
//get the current status of the author-colors
|
||||
var oldValue = inner$("body").hasClass("authorColors");
|
||||
|
||||
//select show author colors and fire change event
|
||||
$colorsCheckbox.attr('selected','selected');
|
||||
$colorsCheckbox.change();
|
||||
$colorsCheckbox.click();
|
||||
|
||||
helper.waitFor(function(){
|
||||
return inner$("body").hasClass("authorColors") == !oldValue;
|
||||
}, 10000).always(function(){
|
||||
var newValue = inner$("body").hasClass("authorColors");
|
||||
expect(oldValue).not.to.be(newValue);
|
||||
expect(newValue).to.be($colorsCheckbox.prop("checked"));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
66
tests/frontend/specs/hide_line_numbers.js
Normal file
66
tests/frontend/specs/hide_line_numbers.js
Normal file
|
@ -0,0 +1,66 @@
|
|||
describe("hiding linenumbers", function(){
|
||||
//create a new pad before each test run
|
||||
beforeEach(function(cb){
|
||||
helper.newPad(cb);
|
||||
this.timeout(60000);
|
||||
});
|
||||
|
||||
it("hides the linenumbers locally", function(done) {
|
||||
var outer$ = helper.padOuter$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
//click on the settings button to make settings visible
|
||||
var $settingsButton = chrome$(".buttonicon-settings");
|
||||
$settingsButton.click();
|
||||
|
||||
//get the chat selector
|
||||
var $linesCheckbox = chrome$("#options-linenoscheck");
|
||||
|
||||
//get the current status of the linenumbers
|
||||
var oldValue = outer$("#sidediv").hasClass("sidedivhidden");
|
||||
|
||||
//select show linenumbers and fire change event
|
||||
$linesCheckbox.attr('selected','selected');
|
||||
$linesCheckbox.change();
|
||||
$linesCheckbox.click();
|
||||
|
||||
//get the current status of the linenumbers
|
||||
var newValue = outer$("#sidediv").hasClass("sidedivhidden");
|
||||
|
||||
expect(oldValue).not.to.be(newValue);
|
||||
expect(newValue).to.be(!$linesCheckbox.prop("checked"));
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it("hides the linenumbers globally", function(done) {
|
||||
var outer$ = helper.padOuter$;
|
||||
var chrome$ = helper.padChrome$;
|
||||
|
||||
this.timeout(10000);
|
||||
|
||||
//click on the settings button to make settings visible
|
||||
var $settingsButton = chrome$(".buttonicon-settings");
|
||||
$settingsButton.click();
|
||||
|
||||
//get the chat selector
|
||||
var $linesCheckbox = chrome$("#options-global-linenoscheck");
|
||||
|
||||
//get the current status of the linenumbers
|
||||
var oldValue = outer$("#sidediv").hasClass("sidedivhidden");
|
||||
|
||||
//select show linenumbers and fire change event
|
||||
$linesCheckbox.attr('selected','selected');
|
||||
$linesCheckbox.change();
|
||||
$linesCheckbox.click();
|
||||
|
||||
helper.waitFor(function(){
|
||||
return outer$("#sidediv").hasClass("sidedivhidden") == !oldValue;
|
||||
}, 10000).always(function(){
|
||||
var newValue = outer$("#sidediv").hasClass("sidedivhidden");
|
||||
expect(oldValue).not.to.be(newValue);
|
||||
expect(newValue).to.be(!$linesCheckbox.prop("checked"));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue