mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
formatting: bulk remove trailing whitespaces on frontend tests
This is a followup on 312c72c364
, which did the same on the main code base,
and is preliminary work for tidying up John's changes in the following commits.
No functional changes.
Command:
find tests/frontend -name '*.js' -type f -print0 | xargs -0 sed --in-place 's/[[:space:]]*$//'
This commit is contained in:
parent
61f0b5db0b
commit
04e9fc3a2f
25 changed files with 152 additions and 152 deletions
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
var name = $flags[i]
|
var name = $flags[i]
|
||||||
, assertion = new Assertion(this.obj, name, this)
|
, assertion = new Assertion(this.obj, name, this)
|
||||||
|
|
||||||
if ('function' == typeof Assertion.prototype[name]) {
|
if ('function' == typeof Assertion.prototype[name]) {
|
||||||
// clone the function, make sure we dont touch the prot reference
|
// clone the function, make sure we dont touch the prot reference
|
||||||
var old = this[name];
|
var old = this[name];
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
if ('object' == typeof fn && not) {
|
if ('object' == typeof fn && not) {
|
||||||
// in the presence of a matcher, ensure the `not` only applies to
|
// in the presence of a matcher, ensure the `not` only applies to
|
||||||
// the matching.
|
// the matching.
|
||||||
this.flags.not = false;
|
this.flags.not = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = this.obj.name || 'fn';
|
var name = this.obj.name || 'fn';
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assert within start to finish (inclusive).
|
* Assert within start to finish (inclusive).
|
||||||
*
|
*
|
||||||
* @param {Number} start
|
* @param {Number} start
|
||||||
* @param {Number} finish
|
* @param {Number} finish
|
||||||
|
@ -298,7 +298,7 @@
|
||||||
, function(){ return 'expected ' + i(this.obj) + ' to be above ' + n });
|
, function(){ return 'expected ' + i(this.obj) + ' to be above ' + n });
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assert string value matches _regexp_.
|
* Assert string value matches _regexp_.
|
||||||
*
|
*
|
||||||
|
@ -359,13 +359,13 @@
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
hasProp = undefined !== this.obj[name]
|
hasProp = undefined !== this.obj[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
this.assert(
|
this.assert(
|
||||||
hasProp
|
hasProp
|
||||||
, function(){ return 'expected ' + i(this.obj) + ' to have a property ' + i(name) }
|
, function(){ return 'expected ' + i(this.obj) + ' to have a property ' + i(name) }
|
||||||
, function(){ return 'expected ' + i(this.obj) + ' to not have a property ' + i(name) });
|
, function(){ return 'expected ' + i(this.obj) + ' to not have a property ' + i(name) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (undefined !== val) {
|
if (undefined !== val) {
|
||||||
this.assert(
|
this.assert(
|
||||||
val === this.obj[name]
|
val === this.obj[name]
|
||||||
|
@ -537,7 +537,7 @@
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Returns true if object is a DOM element.
|
// Returns true if object is a DOM element.
|
||||||
var isDOMElement = function (object) {
|
var isDOMElement = function (object) {
|
||||||
if (typeof HTMLElement === 'object') {
|
if (typeof HTMLElement === 'object') {
|
||||||
|
@ -843,9 +843,9 @@
|
||||||
|
|
||||||
expect.eql = function eql (actual, expected) {
|
expect.eql = function eql (actual, expected) {
|
||||||
// 7.1. All identical values are equivalent, as determined by ===.
|
// 7.1. All identical values are equivalent, as determined by ===.
|
||||||
if (actual === expected) {
|
if (actual === expected) {
|
||||||
return true;
|
return true;
|
||||||
} else if ('undefined' != typeof Buffer
|
} else if ('undefined' != typeof Buffer
|
||||||
&& Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
|
&& Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
|
||||||
if (actual.length != expected.length) return false;
|
if (actual.length != expected.length) return false;
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,11 @@ require.register = function (path, fn){
|
||||||
require.relative = function (parent) {
|
require.relative = function (parent) {
|
||||||
return function(p){
|
return function(p){
|
||||||
if ('.' != p.charAt(0)) return require(p);
|
if ('.' != p.charAt(0)) return require(p);
|
||||||
|
|
||||||
var path = parent.split('/')
|
var path = parent.split('/')
|
||||||
, segs = p.split('/');
|
, segs = p.split('/');
|
||||||
path.pop();
|
path.pop();
|
||||||
|
|
||||||
for (var i = 0; i < segs.length; i++) {
|
for (var i = 0; i < segs.length; i++) {
|
||||||
var seg = segs[i];
|
var seg = segs[i];
|
||||||
if ('..' == seg) path.pop();
|
if ('..' == seg) path.pop();
|
||||||
|
@ -52,7 +52,7 @@ require.register("browser/debug.js", function(module, exports, require){
|
||||||
|
|
||||||
module.exports = function(type){
|
module.exports = function(type){
|
||||||
return function(){
|
return function(){
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}); // module: browser/debug.js
|
}); // module: browser/debug.js
|
||||||
|
@ -530,7 +530,7 @@ var Suite = require('../suite')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BDD-style interface:
|
* BDD-style interface:
|
||||||
*
|
*
|
||||||
* describe('Array', function(){
|
* describe('Array', function(){
|
||||||
* describe('#indexOf()', function(){
|
* describe('#indexOf()', function(){
|
||||||
* it('should return -1 when not present', function(){
|
* it('should return -1 when not present', function(){
|
||||||
|
@ -542,7 +542,7 @@ var Suite = require('../suite')
|
||||||
* });
|
* });
|
||||||
* });
|
* });
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function(suite){
|
module.exports = function(suite){
|
||||||
|
@ -587,7 +587,7 @@ module.exports = function(suite){
|
||||||
* and callback `fn` containing nested suites
|
* and callback `fn` containing nested suites
|
||||||
* and/or tests.
|
* and/or tests.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
context.describe = context.context = function(title, fn){
|
context.describe = context.context = function(title, fn){
|
||||||
var suite = Suite.create(suites[0], title);
|
var suite = Suite.create(suites[0], title);
|
||||||
suites.unshift(suite);
|
suites.unshift(suite);
|
||||||
|
@ -667,19 +667,19 @@ var Suite = require('../suite')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TDD-style interface:
|
* TDD-style interface:
|
||||||
*
|
*
|
||||||
* exports.Array = {
|
* exports.Array = {
|
||||||
* '#indexOf()': {
|
* '#indexOf()': {
|
||||||
* 'should return -1 when the value is not present': function(){
|
* 'should return -1 when the value is not present': function(){
|
||||||
*
|
*
|
||||||
* },
|
* },
|
||||||
*
|
*
|
||||||
* 'should return the correct index when the value is present': function(){
|
* 'should return the correct index when the value is present': function(){
|
||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function(suite){
|
module.exports = function(suite){
|
||||||
|
@ -739,27 +739,27 @@ var Suite = require('../suite')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QUnit-style interface:
|
* QUnit-style interface:
|
||||||
*
|
*
|
||||||
* suite('Array');
|
* suite('Array');
|
||||||
*
|
*
|
||||||
* test('#length', function(){
|
* test('#length', function(){
|
||||||
* var arr = [1,2,3];
|
* var arr = [1,2,3];
|
||||||
* ok(arr.length == 3);
|
* ok(arr.length == 3);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* test('#indexOf()', function(){
|
* test('#indexOf()', function(){
|
||||||
* var arr = [1,2,3];
|
* var arr = [1,2,3];
|
||||||
* ok(arr.indexOf(1) == 0);
|
* ok(arr.indexOf(1) == 0);
|
||||||
* ok(arr.indexOf(2) == 1);
|
* ok(arr.indexOf(2) == 1);
|
||||||
* ok(arr.indexOf(3) == 2);
|
* ok(arr.indexOf(3) == 2);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* suite('String');
|
* suite('String');
|
||||||
*
|
*
|
||||||
* test('#length', function(){
|
* test('#length', function(){
|
||||||
* ok('foo'.length == 3);
|
* ok('foo'.length == 3);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function(suite){
|
module.exports = function(suite){
|
||||||
|
@ -802,7 +802,7 @@ module.exports = function(suite){
|
||||||
/**
|
/**
|
||||||
* Describe a "suite" with the given `title`.
|
* Describe a "suite" with the given `title`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
context.suite = function(title){
|
context.suite = function(title){
|
||||||
if (suites.length > 1) suites.shift();
|
if (suites.length > 1) suites.shift();
|
||||||
var suite = Suite.create(suites[0], title);
|
var suite = Suite.create(suites[0], title);
|
||||||
|
@ -840,7 +840,7 @@ var Suite = require('../suite')
|
||||||
* suiteSetup(function(){
|
* suiteSetup(function(){
|
||||||
*
|
*
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* test('should return -1 when not present', function(){
|
* test('should return -1 when not present', function(){
|
||||||
*
|
*
|
||||||
* });
|
* });
|
||||||
|
@ -2689,7 +2689,7 @@ exports = module.exports = Min;
|
||||||
|
|
||||||
function Min(runner) {
|
function Min(runner) {
|
||||||
Base.call(this, runner);
|
Base.call(this, runner);
|
||||||
|
|
||||||
runner.on('start', function(){
|
runner.on('start', function(){
|
||||||
// clear screen
|
// clear screen
|
||||||
process.stdout.write('\u001b[2J');
|
process.stdout.write('\u001b[2J');
|
||||||
|
@ -3337,7 +3337,7 @@ function XUnit(runner) {
|
||||||
runner.on('pass', function(test){
|
runner.on('pass', function(test){
|
||||||
tests.push(test);
|
tests.push(test);
|
||||||
});
|
});
|
||||||
|
|
||||||
runner.on('fail', function(test){
|
runner.on('fail', function(test){
|
||||||
tests.push(test);
|
tests.push(test);
|
||||||
});
|
});
|
||||||
|
@ -3354,7 +3354,7 @@ function XUnit(runner) {
|
||||||
}, false));
|
}, false));
|
||||||
|
|
||||||
tests.forEach(test);
|
tests.forEach(test);
|
||||||
console.log('</testsuite>');
|
console.log('</testsuite>');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3615,7 +3615,7 @@ Runnable.prototype.run = function(fn){
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sync
|
// sync
|
||||||
try {
|
try {
|
||||||
if (!this.pending) this.fn.call(ctx);
|
if (!this.pending) this.fn.call(ctx);
|
||||||
|
@ -4536,7 +4536,7 @@ exports.indexOf = function(arr, obj, start){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array#reduce (<=IE8)
|
* Array#reduce (<=IE8)
|
||||||
*
|
*
|
||||||
* @param {Array} array
|
* @param {Array} array
|
||||||
* @param {Function} fn
|
* @param {Function} fn
|
||||||
* @param {Object} initial value
|
* @param {Object} initial value
|
||||||
|
|
|
@ -305,11 +305,11 @@ var START_TO_END = 1;
|
||||||
var END_TO_END = 2;
|
var END_TO_END = 2;
|
||||||
var END_TO_START = 3;
|
var END_TO_START = 3;
|
||||||
// from the Mozilla documentation, for range.compareBoundaryPoints(how, sourceRange)
|
// from the Mozilla documentation, for range.compareBoundaryPoints(how, sourceRange)
|
||||||
// -1, 0, or 1, indicating whether the corresponding boundary-point of range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
|
// -1, 0, or 1, indicating whether the corresponding boundary-point of range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
|
||||||
// * Range.END_TO_END compares the end boundary-point of sourceRange to the end boundary-point of range.
|
// * Range.END_TO_END compares the end boundary-point of sourceRange to the end boundary-point of range.
|
||||||
// * Range.END_TO_START compares the end boundary-point of sourceRange to the start boundary-point of range.
|
// * Range.END_TO_START compares the end boundary-point of sourceRange to the start boundary-point of range.
|
||||||
// * Range.START_TO_END compares the start boundary-point of sourceRange to the end boundary-point of range.
|
// * Range.START_TO_END compares the start boundary-point of sourceRange to the end boundary-point of range.
|
||||||
// * Range.START_TO_START compares the start boundary-point of sourceRange to the start boundary-point of range.
|
// * Range.START_TO_START compares the start boundary-point of sourceRange to the start boundary-point of range.
|
||||||
function w3cstart(rng, constraint){
|
function w3cstart(rng, constraint){
|
||||||
if (rng.compareBoundaryPoints (START_TO_START, constraint) <= 0) return 0; // at or before the beginning
|
if (rng.compareBoundaryPoints (START_TO_START, constraint) <= 0) return 0; // at or before the beginning
|
||||||
if (rng.compareBoundaryPoints (END_TO_START, constraint) >= 0) return constraint.toString().length;
|
if (rng.compareBoundaryPoints (END_TO_START, constraint) >= 0) return constraint.toString().length;
|
||||||
|
|
|
@ -52,7 +52,7 @@ $(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This reporter wraps the original html reporter plus reports plain text into a hidden div.
|
This reporter wraps the original html reporter plus reports plain text into a hidden div.
|
||||||
This allows the webdriver client to pick up the test results
|
This allows the webdriver client to pick up the test results
|
||||||
*/
|
*/
|
||||||
var WebdriverAndHtmlReporter = function(html_reporter){
|
var WebdriverAndHtmlReporter = function(html_reporter){
|
||||||
|
@ -170,7 +170,7 @@ $(function(){
|
||||||
|
|
||||||
//get the list of specs and filter it if requested
|
//get the list of specs and filter it if requested
|
||||||
var specs = specs_list.slice();
|
var specs = specs_list.slice();
|
||||||
|
|
||||||
//inject spec scripts into the dom
|
//inject spec scripts into the dom
|
||||||
var $body = $('body');
|
var $body = $('body');
|
||||||
$.each(specs, function(i, spec){
|
$.each(specs, function(i, spec){
|
||||||
|
@ -195,4 +195,4 @@ $(function(){
|
||||||
|
|
||||||
mocha.run();
|
mocha.run();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,12 +8,12 @@ describe("All the alphabet works n stuff", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("when you enter any char it appears right", function(done) {
|
it("when you enter any char it appears right", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var firstTextElement = inner$("div").first();
|
var firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// simulate key presses to delete content
|
// simulate key presses to delete content
|
||||||
firstTextElement.sendkeys('{selectall}'); // select all
|
firstTextElement.sendkeys('{selectall}'); // select all
|
||||||
firstTextElement.sendkeys('{del}'); // clear the first line
|
firstTextElement.sendkeys('{del}'); // clear the first line
|
||||||
|
|
|
@ -6,22 +6,22 @@ describe("bold button", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text bold on click", function(done) {
|
it("makes text bold on click", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var $firstTextElement = inner$("div").first();
|
var $firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
//select this text element
|
//select this text element
|
||||||
$firstTextElement.sendkeys('{selectall}');
|
$firstTextElement.sendkeys('{selectall}');
|
||||||
|
|
||||||
//get the bold button and click it
|
//get the bold button and click it
|
||||||
var $boldButton = chrome$(".buttonicon-bold");
|
var $boldButton = chrome$(".buttonicon-bold");
|
||||||
$boldButton.click();
|
$boldButton.click();
|
||||||
|
|
||||||
//ace creates a new dom element when you press a button, so just get the first text element again
|
//ace creates a new dom element when you press a button, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// is there a <b> element now?
|
// is there a <b> element now?
|
||||||
var isBold = $newFirstTextElement.find("b").length === 1;
|
var isBold = $newFirstTextElement.find("b").length === 1;
|
||||||
|
|
||||||
|
|
|
@ -198,9 +198,9 @@ console.log(inner$);
|
||||||
/*
|
/*
|
||||||
it("Creates N rows, changes height of rows, updates UI by caret key events", function(done){
|
it("Creates N rows, changes height of rows, updates UI by caret key events", function(done){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
var numberOfRows = 50;
|
var numberOfRows = 50;
|
||||||
|
|
||||||
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
var originalDivHeight = inner$("div").first().css("height");
|
var originalDivHeight = inner$("div").first().css("height");
|
||||||
|
@ -211,7 +211,7 @@ console.log(inner$);
|
||||||
}).done(function(){ // Once the DOM has registered the items
|
}).done(function(){ // Once the DOM has registered the items
|
||||||
inner$("div").each(function(index){ // Randomize the item heights (replicates images / headings etc)
|
inner$("div").each(function(index){ // Randomize the item heights (replicates images / headings etc)
|
||||||
var random = Math.floor(Math.random() * (50)) + 20;
|
var random = Math.floor(Math.random() * (50)) + 20;
|
||||||
$(this).css("height", random+"px");
|
$(this).css("height", random+"px");
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(caretPosition(inner$));
|
console.log(caretPosition(inner$));
|
||||||
|
@ -253,7 +253,7 @@ console.log(inner$);
|
||||||
keyEvent(inner$, 33, false, false); // doesn't work
|
keyEvent(inner$, 33, false, false); // doesn't work
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does scrolling back up the pad with the up arrow show the correct contents?
|
// Does scrolling back up the pad with the up arrow show the correct contents?
|
||||||
helper.waitFor(function(){ // Wait for the new position to be in place
|
helper.waitFor(function(){ // Wait for the new position to be in place
|
||||||
try{
|
try{
|
||||||
|
@ -280,7 +280,7 @@ console.log(inner$);
|
||||||
helper.waitFor(function(){ // Wait for the new position to be in place
|
helper.waitFor(function(){ // Wait for the new position to be in place
|
||||||
return isScrolledIntoView(inner$("div:nth-child(1)"), inner$); // Wait for the DOM to scroll into place
|
return isScrolledIntoView(inner$("div:nth-child(1)"), inner$); // Wait for the DOM to scroll into place
|
||||||
}).done(function(){ // Once the DOM has registered the items
|
}).done(function(){ // Once the DOM has registered the items
|
||||||
expect(true).to.be(true);
|
expect(true).to.be(true);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
@ -297,7 +297,7 @@ function prepareDocument(n, target){ // generates a random document with random
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window
|
function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window
|
||||||
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
|
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
|
||||||
var evtType = "keypress";
|
var evtType = "keypress";
|
||||||
}else{
|
}else{
|
||||||
var evtType = "keydown";
|
var evtType = "keydown";
|
||||||
|
@ -310,7 +310,7 @@ function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the win
|
||||||
if(shift){
|
if(shift){
|
||||||
e.shiftKey = true; // Shift Key
|
e.shiftKey = true; // Shift Key
|
||||||
}
|
}
|
||||||
e.which = charCode;
|
e.which = charCode;
|
||||||
e.keyCode = charCode;
|
e.keyCode = charCode;
|
||||||
target("#innerdocbody").trigger(e);
|
target("#innerdocbody").trigger(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe("change username value", function(){
|
||||||
//click on the settings button to make settings visible
|
//click on the settings button to make settings visible
|
||||||
var $userButton = chrome$(".buttonicon-showusers");
|
var $userButton = chrome$(".buttonicon-showusers");
|
||||||
$userButton.click();
|
$userButton.click();
|
||||||
|
|
||||||
var $usernameInput = chrome$("#myusernameedit");
|
var $usernameInput = chrome$("#myusernameedit");
|
||||||
$usernameInput.click();
|
$usernameInput.click();
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ describe("change username value", function(){
|
||||||
//click on the settings button to make settings visible
|
//click on the settings button to make settings visible
|
||||||
var $userButton = chrome$(".buttonicon-showusers");
|
var $userButton = chrome$(".buttonicon-showusers");
|
||||||
$userButton.click();
|
$userButton.click();
|
||||||
|
|
||||||
var $usernameInput = chrome$("#myusernameedit");
|
var $usernameInput = chrome$("#myusernameedit");
|
||||||
$usernameInput.click();
|
$usernameInput.click();
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ describe("Chat messages and UI", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opens chat, sends a message and makes sure it exists on the page", function(done) {
|
it("opens chat, sends a message and makes sure it exists on the page", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
var chatValue = "JohnMcLear";
|
var chatValue = "JohnMcLear";
|
||||||
|
|
||||||
//click on the chat button to make chat visible
|
//click on the chat button to make chat visible
|
||||||
|
@ -39,8 +39,8 @@ describe("Chat messages and UI", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes sure that an empty message can't be sent", function(done) {
|
it("makes sure that an empty message can't be sent", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//click on the chat button to make chat visible
|
//click on the chat button to make chat visible
|
||||||
var $chatButton = chrome$("#chaticon");
|
var $chatButton = chrome$("#chaticon");
|
||||||
|
@ -65,8 +65,8 @@ describe("Chat messages and UI", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes chat stick to right side of the screen", function(done) {
|
it("makes chat stick to right side of the screen", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//click on the settings button to make settings visible
|
//click on the settings button to make settings visible
|
||||||
var $settingsButton = chrome$(".buttonicon-settings");
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
|
@ -98,8 +98,8 @@ describe("Chat messages and UI", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes chat stick to right side of the screen then makes it one step smaller", function(done) {
|
it("makes chat stick to right side of the screen then makes it one step smaller", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//click on the settings button to make settings visible
|
//click on the settings button to make settings visible
|
||||||
var $settingsButton = chrome$(".buttonicon-settings");
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
describe("chat-load-messages", function(){
|
describe("chat-load-messages", function(){
|
||||||
var padName;
|
var padName;
|
||||||
|
|
||||||
it("creates a pad", function(done) {
|
it("creates a pad", function(done) {
|
||||||
padName = helper.newPad(done);
|
padName = helper.newPad(done);
|
||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("adds a lot of messages", function(done) {
|
it("adds a lot of messages", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
var chatButton = chrome$("#chaticon");
|
var chatButton = chrome$("#chaticon");
|
||||||
chatButton.click();
|
chatButton.click();
|
||||||
var chatInput = chrome$("#chatinput");
|
var chatInput = chrome$("#chatinput");
|
||||||
var chatText = chrome$("#chattext");
|
var chatText = chrome$("#chattext");
|
||||||
|
|
||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
|
|
||||||
var messages = 140;
|
var messages = 140;
|
||||||
for(var i=1; i <= messages; i++) {
|
for(var i=1; i <= messages; i++) {
|
||||||
var num = ''+i;
|
var num = ''+i;
|
||||||
|
@ -33,7 +33,7 @@ describe("chat-load-messages", function(){
|
||||||
helper.newPad(done, padName);
|
helper.newPad(done, padName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("checks initial message count", function(done) {
|
it("checks initial message count", function(done) {
|
||||||
var chatText;
|
var chatText;
|
||||||
var expectedCount = 101;
|
var expectedCount = 101;
|
||||||
|
@ -48,7 +48,7 @@ describe("chat-load-messages", function(){
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("loads more messages", function(done) {
|
it("loads more messages", function(done) {
|
||||||
var expectedCount = 122;
|
var expectedCount = 122;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
@ -56,7 +56,7 @@ describe("chat-load-messages", function(){
|
||||||
chatButton.click();
|
chatButton.click();
|
||||||
var chatText = chrome$("#chattext");
|
var chatText = chrome$("#chattext");
|
||||||
var loadMsgBtn = chrome$("#chatloadmessagesbutton");
|
var loadMsgBtn = chrome$("#chatloadmessagesbutton");
|
||||||
|
|
||||||
loadMsgBtn.click();
|
loadMsgBtn.click();
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
return chatText.children("p").length == expectedCount;
|
return chatText.children("p").length == expectedCount;
|
||||||
|
@ -65,7 +65,7 @@ describe("chat-load-messages", function(){
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("checks for button vanishing", function(done) {
|
it("checks for button vanishing", function(done) {
|
||||||
var expectedDisplay = 'none';
|
var expectedDisplay = 'none';
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
|
@ -6,8 +6,8 @@ describe("clear authorship colors button", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text clear authorship colors", function(done) {
|
it("makes text clear authorship colors", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// override the confirm dialogue functioon
|
// override the confirm dialogue functioon
|
||||||
helper.padChrome$.window.confirm = function(){
|
helper.padChrome$.window.confirm = function(){
|
||||||
|
@ -19,7 +19,7 @@ describe("clear authorship colors button", function(){
|
||||||
|
|
||||||
// Get the original text
|
// Get the original text
|
||||||
var originalText = inner$("div").first().text();
|
var originalText = inner$("div").first().text();
|
||||||
|
|
||||||
// Set some new text
|
// Set some new text
|
||||||
var sentText = "Hello";
|
var sentText = "Hello";
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@ describe("delete keystroke", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text delete", function(done) {
|
it("makes text delete", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var $firstTextElement = inner$("div").first();
|
var $firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// get the original length of this element
|
// get the original length of this element
|
||||||
var elementLength = $firstTextElement.text().length;
|
var elementLength = $firstTextElement.text().length;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ describe("delete keystroke", function(){
|
||||||
|
|
||||||
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// get the new length of this element
|
// get the new length of this element
|
||||||
var newElementLength = $newFirstTextElement.text().length;
|
var newElementLength = $newFirstTextElement.text().length;
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ describe("embed links", function(){
|
||||||
var $embediFrame = $(embedCode);
|
var $embediFrame = $(embedCode);
|
||||||
|
|
||||||
//read and check the frame attributes
|
//read and check the frame attributes
|
||||||
var width = $embediFrame.attr("width");
|
var width = $embediFrame.attr("width");
|
||||||
var height = $embediFrame.attr("height");
|
var height = $embediFrame.attr("height");
|
||||||
var name = $embediFrame.attr("name");
|
var name = $embediFrame.attr("name");
|
||||||
expect(width).to.be('600');
|
expect(width).to.be('600');
|
||||||
expect(height).to.be('400');
|
expect(height).to.be('400');
|
||||||
expect(name).to.be(readonly ? "embed_readonly" : "embed_readwrite");
|
expect(name).to.be(readonly ? "embed_readonly" : "embed_readwrite");
|
||||||
|
@ -43,7 +43,7 @@ describe("embed links", function(){
|
||||||
} else {
|
} else {
|
||||||
expect(url).to.be(helper.padChrome$.window.location.href);
|
expect(url).to.be(helper.padChrome$.window.location.href);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if all parts of the url are like expected
|
//check if all parts of the url are like expected
|
||||||
expect(params).to.eql(expectedParams);
|
expect(params).to.eql(expectedParams);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ describe("embed links", function(){
|
||||||
|
|
||||||
describe("the share link", function(){
|
describe("the share link", function(){
|
||||||
it("is the actual pad url", function(done){
|
it("is the actual pad url", function(done){
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//open share dropdown
|
//open share dropdown
|
||||||
chrome$(".buttonicon-embed").click();
|
chrome$(".buttonicon-embed").click();
|
||||||
|
@ -73,14 +73,14 @@ describe("embed links", function(){
|
||||||
|
|
||||||
describe("the embed as iframe code", function(){
|
describe("the embed as iframe code", function(){
|
||||||
it("is an iframe with the the correct url parameters and correct size", function(done){
|
it("is an iframe with the the correct url parameters and correct size", function(done){
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//open share dropdown
|
//open share dropdown
|
||||||
chrome$(".buttonicon-embed").click();
|
chrome$(".buttonicon-embed").click();
|
||||||
|
|
||||||
//get the link of the share field + the actual pad url and compare them
|
//get the link of the share field + the actual pad url and compare them
|
||||||
var embedCode = chrome$("#embedinput").val();
|
var embedCode = chrome$("#embedinput").val();
|
||||||
|
|
||||||
checkiFrameCode(embedCode, false)
|
checkiFrameCode(embedCode, false)
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
@ -96,7 +96,7 @@ describe("embed links", function(){
|
||||||
|
|
||||||
describe("the share link", function(){
|
describe("the share link", function(){
|
||||||
it("shows a read only url", function(done){
|
it("shows a read only url", function(done){
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//open share dropdown
|
//open share dropdown
|
||||||
chrome$(".buttonicon-embed").click();
|
chrome$(".buttonicon-embed").click();
|
||||||
|
@ -114,7 +114,7 @@ describe("embed links", function(){
|
||||||
|
|
||||||
describe("the embed as iframe code", function(){
|
describe("the embed as iframe code", function(){
|
||||||
it("is an iframe with the the correct url parameters and correct size", function(done){
|
it("is an iframe with the the correct url parameters and correct size", function(done){
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//open share dropdown
|
//open share dropdown
|
||||||
chrome$(".buttonicon-embed").click();
|
chrome$(".buttonicon-embed").click();
|
||||||
|
@ -125,9 +125,9 @@ describe("embed links", function(){
|
||||||
|
|
||||||
//get the link of the share field + the actual pad url and compare them
|
//get the link of the share field + the actual pad url and compare them
|
||||||
var embedCode = chrome$("#embedinput").val();
|
var embedCode = chrome$("#embedinput").val();
|
||||||
|
|
||||||
checkiFrameCode(embedCode, true);
|
checkiFrameCode(embedCode, true);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,12 +6,12 @@ describe("enter keystroke", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("creates a new line & puts cursor onto a new line", function(done) {
|
it("creates a new line & puts cursor onto a new line", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var $firstTextElement = inner$("div").first();
|
var $firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// get the original string value minus the last char
|
// get the original string value minus the last char
|
||||||
var originalTextValue = $firstTextElement.text();
|
var originalTextValue = $firstTextElement.text();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ describe("enter keystroke", function(){
|
||||||
|
|
||||||
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
//ace creates a new dom element when you press a keystroke, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
|
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
return inner$("div").first().text() === "";
|
return inner$("div").first().text() === "";
|
||||||
}).done(function(){
|
}).done(function(){
|
||||||
|
|
|
@ -6,8 +6,8 @@ describe("font select", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text monospace", function(done) {
|
it("makes text monospace", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//click on the settings button to make settings visible
|
//click on the settings button to make settings visible
|
||||||
var $settingsButton = chrome$(".buttonicon-settings");
|
var $settingsButton = chrome$(".buttonicon-settings");
|
||||||
|
|
|
@ -159,7 +159,7 @@ describe("import functionality", function(){
|
||||||
//<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
|
//<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
|
||||||
//<br>\n')
|
//<br>\n')
|
||||||
})
|
})
|
||||||
|
|
||||||
var results = exportfunc(helper.padChrome$.window.location.href)
|
var results = exportfunc(helper.padChrome$.window.location.href)
|
||||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li><ul><ul class="bullet"><li>bullet4 line 2</li><li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul></ul><li>bullet2 line 1</li></ul><br>')
|
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li><ul><ul class="bullet"><li>bullet4 line 2</li><li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul></ul><li>bullet2 line 1</li></ul><br>')
|
||||||
expect(results[1][1]).to.be('\t* bullet line 1\n\t* bullet line 2\n\t\t* bullet2 line 1\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t* bullet3 line 1\n\t* bullet2 line 1\n\n')
|
expect(results[1][1]).to.be('\t* bullet line 1\n\t* bullet line 2\n\t\t* bullet2 line 1\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t* bullet3 line 1\n\t* bullet2 line 1\n\n')
|
||||||
|
@ -183,11 +183,11 @@ describe("import functionality", function(){
|
||||||
<br>\n')
|
<br>\n')
|
||||||
})
|
})
|
||||||
var results = exportfunc(helper.padChrome$.window.location.href)
|
var results = exportfunc(helper.padChrome$.window.location.href)
|
||||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul><br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>bullet4 line 2 bisu</u></s></em></strong></li><li><strong><s>bullet4 line 2 bs</s></strong></li><li><u>bullet4 line 2 u<em><s>uis</s></em></u></li><ul><ul><ul><ul class="bullet"><li>foo</li><li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li></ul></ul></ul></ul></ul><br>')
|
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul><br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>bullet4 line 2 bisu</u></s></em></strong></li><li><strong><s>bullet4 line 2 bs</s></strong></li><li><u>bullet4 line 2 u<em><s>uis</s></em></u></li><ul><ul><ul><ul class="bullet"><li>foo</li><li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li></ul></ul></ul></ul></ul><br>')
|
||||||
expect(results[1][1]).to.be('\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t\t\t* bullet4 line 2 bisu\n\t\t\t\t* bullet4 line 2 bs\n\t\t\t\t* bullet4 line 2 uuis\n\t\t\t\t\t\t\t\t* foo\n\t\t\t\t\t\t\t\t* foobar bs\n\t\t\t\t\t* foobar\n\n')
|
expect(results[1][1]).to.be('\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t\t\t* bullet4 line 2 bisu\n\t\t\t\t* bullet4 line 2 bs\n\t\t\t\t* bullet4 line 2 uuis\n\t\t\t\t\t\t\t\t* foo\n\t\t\t\t\t\t\t\t* foobar bs\n\t\t\t\t\t* foobar\n\n')
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
|
||||||
xit("import a pad with ordered lists from html", function(done){
|
xit("import a pad with ordered lists from html", function(done){
|
||||||
var importurl = helper.padChrome$.window.location.href+'/import'
|
var importurl = helper.padChrome$.window.location.href+'/import'
|
||||||
var htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li>number 1 line 1</li></ol><ol class="list-number1" start="2"><li>number 2 line 2</li></ol></body></html>'
|
var htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li>number 1 line 1</li></ol><ol class="list-number1" start="2"><li>number 2 line 2</li></ol></body></html>'
|
||||||
|
|
|
@ -66,7 +66,7 @@ describe("import indents functionality", function(){
|
||||||
expect(results[1][1]).to.be('\tindent line 1\n\tindent line 2\n\t\tindent2 line 1\n\t\tindent2 line 2\n\n')
|
expect(results[1][1]).to.be('\tindent line 1\n\tindent line 2\n\t\tindent2 line 1\n\t\tindent2 line 2\n\n')
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
|
||||||
xit("import a pad with indented lists and newlines from html", function(done){
|
xit("import a pad with indented lists and newlines from html", function(done){
|
||||||
var importurl = helper.padChrome$.window.location.href+'/import'
|
var importurl = helper.padChrome$.window.location.href+'/import'
|
||||||
var htmlWithIndents = '<html><body><ul class="list-indent1"><li>indent line 1</li></ul><br/><ul class="list-indent1"><li>indent 1 line 2</li><ul class="list-indent2"><li>indent 2 times line 1</li></ul></ul><br/><ul class="list-indent1"><ul class="list-indent2"><li>indent 2 times line 2</li></ul></ul></body></html>'
|
var htmlWithIndents = '<html><body><ul class="list-indent1"><li>indent line 1</li></ul><br/><ul class="list-indent1"><li>indent 1 line 2</li><ul class="list-indent2"><li>indent 2 times line 1</li></ul></ul><br/><ul class="list-indent1"><ul class="list-indent2"><li>indent 2 times line 2</li></ul></ul></body></html>'
|
||||||
|
@ -104,7 +104,7 @@ describe("import indents functionality", function(){
|
||||||
<br>\n')
|
<br>\n')
|
||||||
})
|
})
|
||||||
var results = exportfunc(helper.padChrome$.window.location.href)
|
var results = exportfunc(helper.padChrome$.window.location.href)
|
||||||
expect(results[0][1]).to.be('<ul class="indent"><li>indent line 1</li></ul><br><ul class="indent"><li>indent line 2</li><ul class="indent"><li>indent2 line 1</li></ul></ul><br><ul><ul><ul><ul class="indent"><li><strong><em><s><u>indent4 line 2 bisu</u></s></em></strong></li><li><strong><s>indent4 line 2 bs</s></strong></li><li><u>indent4 line 2 u<em><s>uis</s></em></u></li><ul><ul><ul><ul class="indent"><li>foo</li><li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li></ul></ul></ul></ul></ul><br>')
|
expect(results[0][1]).to.be('<ul class="indent"><li>indent line 1</li></ul><br><ul class="indent"><li>indent line 2</li><ul class="indent"><li>indent2 line 1</li></ul></ul><br><ul><ul><ul><ul class="indent"><li><strong><em><s><u>indent4 line 2 bisu</u></s></em></strong></li><li><strong><s>indent4 line 2 bs</s></strong></li><li><u>indent4 line 2 u<em><s>uis</s></em></u></li><ul><ul><ul><ul class="indent"><li>foo</li><li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li></ul></ul></ul></ul></ul><br>')
|
||||||
expect(results[1][1]).to.be('\tindent line 1\n\n\tindent line 2\n\t\tindent2 line 1\n\n\t\t\t\tindent4 line 2 bisu\n\t\t\t\tindent4 line 2 bs\n\t\t\t\tindent4 line 2 uuis\n\t\t\t\t\t\t\t\tfoo\n\t\t\t\t\t\t\t\tfoobar bs\n\t\t\t\t\tfoobar\n\n')
|
expect(results[1][1]).to.be('\tindent line 1\n\n\tindent line 2\n\t\tindent2 line 1\n\n\t\t\t\tindent4 line 2 bisu\n\t\t\t\tindent4 line 2 bs\n\t\t\t\tindent4 line 2 uuis\n\t\t\t\t\t\t\t\tfoo\n\t\t\t\t\t\t\t\tfoobar bs\n\t\t\t\t\tfoobar\n\n')
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,22 +6,22 @@ describe("italic some text", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text italic using button", function(done) {
|
it("makes text italic using button", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var $firstTextElement = inner$("div").first();
|
var $firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
//select this text element
|
//select this text element
|
||||||
$firstTextElement.sendkeys('{selectall}');
|
$firstTextElement.sendkeys('{selectall}');
|
||||||
|
|
||||||
//get the bold button and click it
|
//get the bold button and click it
|
||||||
var $boldButton = chrome$(".buttonicon-italic");
|
var $boldButton = chrome$(".buttonicon-italic");
|
||||||
$boldButton.click();
|
$boldButton.click();
|
||||||
|
|
||||||
//ace creates a new dom element when you press a button, so just get the first text element again
|
//ace creates a new dom element when you press a button, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// is there a <i> element now?
|
// is there a <i> element now?
|
||||||
var isItalic = $newFirstTextElement.find("i").length === 1;
|
var isItalic = $newFirstTextElement.find("i").length === 1;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe("undo button then redo button", function(){
|
||||||
it("redo some typing with button", function(done){
|
it("redo some typing with button", function(done){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// get the first text element inside the editable space
|
// get the first text element inside the editable space
|
||||||
var $firstTextElement = inner$("div span").first();
|
var $firstTextElement = inner$("div span").first();
|
||||||
var originalValue = $firstTextElement.text(); // get the original value
|
var originalValue = $firstTextElement.text(); // get the original value
|
||||||
|
@ -47,7 +47,7 @@ describe("undo button then redo button", function(){
|
||||||
var modifiedValue = $firstTextElement.text(); // get the modified value
|
var modifiedValue = $firstTextElement.text(); // get the modified value
|
||||||
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
|
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
|
||||||
|
|
||||||
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
|
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
|
||||||
var evtType = "keypress";
|
var evtType = "keypress";
|
||||||
}else{
|
}else{
|
||||||
var evtType = "keydown";
|
var evtType = "keydown";
|
||||||
|
|
|
@ -6,22 +6,22 @@ describe("strikethrough button", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes text strikethrough", function(done) {
|
it("makes text strikethrough", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//get the first text element out of the inner iframe
|
//get the first text element out of the inner iframe
|
||||||
var $firstTextElement = inner$("div").first();
|
var $firstTextElement = inner$("div").first();
|
||||||
|
|
||||||
//select this text element
|
//select this text element
|
||||||
$firstTextElement.sendkeys('{selectall}');
|
$firstTextElement.sendkeys('{selectall}');
|
||||||
|
|
||||||
//get the strikethrough button and click it
|
//get the strikethrough button and click it
|
||||||
var $strikethroughButton = chrome$(".buttonicon-strikethrough");
|
var $strikethroughButton = chrome$(".buttonicon-strikethrough");
|
||||||
$strikethroughButton.click();
|
$strikethroughButton.click();
|
||||||
|
|
||||||
//ace creates a new dom element when you press a button, so just get the first text element again
|
//ace creates a new dom element when you press a button, so just get the first text element again
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var $newFirstTextElement = inner$("div").first();
|
||||||
|
|
||||||
// is there a <i> element now?
|
// is there a <i> element now?
|
||||||
var isstrikethrough = $newFirstTextElement.find("s").length === 1;
|
var isstrikethrough = $newFirstTextElement.find("s").length === 1;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ xdescribe("timeslider button takes you to the timeslider of a pad", function(){
|
||||||
it("timeslider contained in URL", function(done){
|
it("timeslider contained in URL", function(done){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// get the first text element inside the editable space
|
// get the first text element inside the editable space
|
||||||
var $firstTextElement = inner$("div span").first();
|
var $firstTextElement = inner$("div span").first();
|
||||||
var originalValue = $firstTextElement.text(); // get the original value
|
var originalValue = $firstTextElement.text(); // get the original value
|
||||||
|
|
|
@ -6,9 +6,9 @@ describe("timeslider", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Shows a date and time in the timeslider and make sure it doesn't include NaN", function(done) {
|
it("Shows a date and time in the timeslider and make sure it doesn't include NaN", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// make some changes to produce 100 revisions
|
// make some changes to produce 100 revisions
|
||||||
var revs = 10;
|
var revs = 10;
|
||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
|
@ -18,15 +18,15 @@ describe("timeslider", function(){
|
||||||
inner$("div").first().sendkeys('a');
|
inner$("div").first().sendkeys('a');
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// go to timeslider
|
// go to timeslider
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
||||||
var $sliderBar = timeslider$('#ui-slider-bar');
|
var $sliderBar = timeslider$('#ui-slider-bar');
|
||||||
|
|
||||||
var latestContents = timeslider$('#padcontent').text();
|
var latestContents = timeslider$('#padcontent').text();
|
||||||
|
|
||||||
// Expect the date and time to be shown
|
// Expect the date and time to be shown
|
||||||
|
@ -36,17 +36,17 @@ describe("timeslider", function(){
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 45;
|
e.clientY = e.pageY = 45;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
e = new jQuery.Event('mousedown');
|
e = new jQuery.Event('mousedown');
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 40;
|
e.clientY = e.pageY = 40;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
e = new jQuery.Event('mousedown');
|
e = new jQuery.Event('mousedown');
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 50;
|
e.clientY = e.pageY = 50;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
$sliderBar.trigger('mouseup')
|
$sliderBar.trigger('mouseup')
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
@ -6,9 +6,9 @@ describe("timeslider", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("loads adds a hundred revisions", function(done) { // passes
|
it("loads adds a hundred revisions", function(done) { // passes
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// make some changes to produce 100 revisions
|
// make some changes to produce 100 revisions
|
||||||
var timePerRev = 900
|
var timePerRev = 900
|
||||||
, revs = 100;
|
, revs = 100;
|
||||||
|
@ -20,15 +20,15 @@ describe("timeslider", function(){
|
||||||
}, timePerRev*i);
|
}, timePerRev*i);
|
||||||
}
|
}
|
||||||
chrome$('.buttonicon-savedRevision').click();
|
chrome$('.buttonicon-savedRevision').click();
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// go to timeslider
|
// go to timeslider
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
||||||
var $sliderBar = timeslider$('#ui-slider-bar');
|
var $sliderBar = timeslider$('#ui-slider-bar');
|
||||||
|
|
||||||
var latestContents = timeslider$('#padcontent').text();
|
var latestContents = timeslider$('#padcontent').text();
|
||||||
|
|
||||||
// Click somewhere on the timeslider
|
// Click somewhere on the timeslider
|
||||||
|
@ -36,17 +36,17 @@ describe("timeslider", function(){
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 45;
|
e.clientY = e.pageY = 45;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
e = new jQuery.Event('mousedown');
|
e = new jQuery.Event('mousedown');
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 40;
|
e.clientY = e.pageY = 40;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
e = new jQuery.Event('mousedown');
|
e = new jQuery.Event('mousedown');
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 50;
|
e.clientY = e.pageY = 50;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
$sliderBar.trigger('mouseup')
|
$sliderBar.trigger('mouseup')
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -56,7 +56,7 @@ describe("timeslider", function(){
|
||||||
expect( starIsVisible ).to.eql( true );
|
expect( starIsVisible ).to.eql( true );
|
||||||
done();
|
done();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
}, 6000);
|
}, 6000);
|
||||||
}, revs*timePerRev);
|
}, revs*timePerRev);
|
||||||
});
|
});
|
||||||
|
@ -64,9 +64,9 @@ describe("timeslider", function(){
|
||||||
|
|
||||||
// Disabled as jquery trigger no longer works properly
|
// Disabled as jquery trigger no longer works properly
|
||||||
xit("changes the url when clicking on the timeslider", function(done) {
|
xit("changes the url when clicking on the timeslider", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// make some changes to produce 7 revisions
|
// make some changes to produce 7 revisions
|
||||||
var timePerRev = 1000
|
var timePerRev = 1000
|
||||||
, revs = 20;
|
, revs = 20;
|
||||||
|
@ -77,24 +77,24 @@ describe("timeslider", function(){
|
||||||
inner$("div").first().sendkeys('a');
|
inner$("div").first().sendkeys('a');
|
||||||
}, timePerRev*i);
|
}, timePerRev*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// go to timeslider
|
// go to timeslider
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
||||||
var $sliderBar = timeslider$('#ui-slider-bar');
|
var $sliderBar = timeslider$('#ui-slider-bar');
|
||||||
|
|
||||||
var latestContents = timeslider$('#padcontent').text();
|
var latestContents = timeslider$('#padcontent').text();
|
||||||
var oldUrl = $('#iframe-container iframe')[0].contentWindow.location.hash;
|
var oldUrl = $('#iframe-container iframe')[0].contentWindow.location.hash;
|
||||||
|
|
||||||
// Click somewhere on the timeslider
|
// Click somewhere on the timeslider
|
||||||
var e = new jQuery.Event('mousedown');
|
var e = new jQuery.Event('mousedown');
|
||||||
e.clientX = e.pageX = 150;
|
e.clientX = e.pageX = 150;
|
||||||
e.clientY = e.pageY = 60;
|
e.clientY = e.pageY = 60;
|
||||||
$sliderBar.trigger(e);
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
return $('#iframe-container iframe')[0].contentWindow.location.hash != oldUrl;
|
return $('#iframe-container iframe')[0].contentWindow.location.hash != oldUrl;
|
||||||
}, 6000).always(function(){
|
}, 6000).always(function(){
|
||||||
|
@ -105,7 +105,7 @@ describe("timeslider", function(){
|
||||||
}, revs*timePerRev);
|
}, revs*timePerRev);
|
||||||
});
|
});
|
||||||
it("jumps to a revision given in the url", function(done) {
|
it("jumps to a revision given in the url", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ describe("timeslider", function(){
|
||||||
expect( oldLength ).to.not.eql( 0 );
|
expect( oldLength ).to.not.eql( 0 );
|
||||||
inner$("div").first().sendkeys('a');
|
inner$("div").first().sendkeys('a');
|
||||||
var timeslider$;
|
var timeslider$;
|
||||||
|
|
||||||
// wait for our additional revision to be added
|
// wait for our additional revision to be added
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
// newLines takes the new lines into account which are strippen when using
|
// newLines takes the new lines into account which are strippen when using
|
||||||
|
@ -131,7 +131,7 @@ describe("timeslider", function(){
|
||||||
}, 6000).always(function() {
|
}, 6000).always(function() {
|
||||||
// go to timeslider with a specific revision set
|
// go to timeslider with a specific revision set
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
|
||||||
|
|
||||||
// wait for the timeslider to be loaded
|
// wait for the timeslider to be loaded
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
try {
|
try {
|
||||||
|
@ -149,17 +149,17 @@ describe("timeslider", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("checks the export url", function(done) {
|
it("checks the export url", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
this.timeout(11000);
|
this.timeout(11000);
|
||||||
inner$("div").first().sendkeys('a');
|
inner$("div").first().sendkeys('a');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// go to timeslider
|
// go to timeslider
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
|
||||||
var timeslider$;
|
var timeslider$;
|
||||||
var exportLink;
|
var exportLink;
|
||||||
|
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
try{
|
try{
|
||||||
timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe("undo button", function(){
|
||||||
it("undo some typing by clicking undo button", function(done){
|
it("undo some typing by clicking undo button", function(done){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
// get the first text element inside the editable space
|
// get the first text element inside the editable space
|
||||||
var $firstTextElement = inner$("div span").first();
|
var $firstTextElement = inner$("div span").first();
|
||||||
var originalValue = $firstTextElement.text(); // get the original value
|
var originalValue = $firstTextElement.text(); // get the original value
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe("assign unordered list", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("insert unordered list text then removes by outdent", function(done){
|
it("insert unordered list text then removes by outdent", function(done){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
var originalText = inner$("div").first().text();
|
var originalText = inner$("div").first().text();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue