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:]]*$//'
pull/3885/head
muxator 2020-03-24 01:04:24 +01:00 committed by muxator
parent 61f0b5db0b
commit 04e9fc3a2f
25 changed files with 152 additions and 152 deletions

View File

@ -65,7 +65,7 @@
var name = $flags[i]
, assertion = new Assertion(this.obj, name, this)
if ('function' == typeof Assertion.prototype[name]) {
// clone the function, make sure we dont touch the prot reference
var old = this[name];
@ -148,7 +148,7 @@
if ('object' == typeof fn && not) {
// in the presence of a matcher, ensure the `not` only applies to
// the matching.
this.flags.not = false;
this.flags.not = false;
}
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} finish
@ -298,7 +298,7 @@
, function(){ return 'expected ' + i(this.obj) + ' to be above ' + n });
return this;
};
/**
* Assert string value matches _regexp_.
*
@ -359,13 +359,13 @@
} catch (e) {
hasProp = undefined !== this.obj[name]
}
this.assert(
hasProp
, 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) });
}
if (undefined !== val) {
this.assert(
val === this.obj[name]
@ -537,7 +537,7 @@
return html;
}
};
// Returns true if object is a DOM element.
var isDOMElement = function (object) {
if (typeof HTMLElement === 'object') {
@ -843,9 +843,9 @@
expect.eql = function eql (actual, expected) {
// 7.1. All identical values are equivalent, as determined by ===.
if (actual === expected) {
if (actual === expected) {
return true;
} else if ('undefined' != typeof Buffer
} else if ('undefined' != typeof Buffer
&& Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
if (actual.length != expected.length) return false;

View File

@ -32,11 +32,11 @@ require.register = function (path, fn){
require.relative = function (parent) {
return function(p){
if ('.' != p.charAt(0)) return require(p);
var path = parent.split('/')
, segs = p.split('/');
path.pop();
for (var i = 0; i < segs.length; i++) {
var seg = segs[i];
if ('..' == seg) path.pop();
@ -52,7 +52,7 @@ require.register("browser/debug.js", function(module, exports, require){
module.exports = function(type){
return function(){
}
};
}); // module: browser/debug.js
@ -530,7 +530,7 @@ var Suite = require('../suite')
/**
* BDD-style interface:
*
*
* describe('Array', function(){
* describe('#indexOf()', function(){
* it('should return -1 when not present', function(){
@ -542,7 +542,7 @@ var Suite = require('../suite')
* });
* });
* });
*
*
*/
module.exports = function(suite){
@ -587,7 +587,7 @@ module.exports = function(suite){
* and callback `fn` containing nested suites
* and/or tests.
*/
context.describe = context.context = function(title, fn){
var suite = Suite.create(suites[0], title);
suites.unshift(suite);
@ -667,19 +667,19 @@ var Suite = require('../suite')
/**
* TDD-style interface:
*
*
* exports.Array = {
* '#indexOf()': {
* 'should return -1 when the value is not present': function(){
*
*
* },
*
* 'should return the correct index when the value is present': function(){
*
*
* }
* }
* };
*
*
*/
module.exports = function(suite){
@ -739,27 +739,27 @@ var Suite = require('../suite')
/**
* QUnit-style interface:
*
*
* suite('Array');
*
*
* test('#length', function(){
* var arr = [1,2,3];
* ok(arr.length == 3);
* });
*
*
* test('#indexOf()', function(){
* var arr = [1,2,3];
* ok(arr.indexOf(1) == 0);
* ok(arr.indexOf(2) == 1);
* ok(arr.indexOf(3) == 2);
* });
*
*
* suite('String');
*
*
* test('#length', function(){
* ok('foo'.length == 3);
* });
*
*
*/
module.exports = function(suite){
@ -802,7 +802,7 @@ module.exports = function(suite){
/**
* Describe a "suite" with the given `title`.
*/
context.suite = function(title){
if (suites.length > 1) suites.shift();
var suite = Suite.create(suites[0], title);
@ -840,7 +840,7 @@ var Suite = require('../suite')
* suiteSetup(function(){
*
* });
*
*
* test('should return -1 when not present', function(){
*
* });
@ -2689,7 +2689,7 @@ exports = module.exports = Min;
function Min(runner) {
Base.call(this, runner);
runner.on('start', function(){
// clear screen
process.stdout.write('\u001b[2J');
@ -3337,7 +3337,7 @@ function XUnit(runner) {
runner.on('pass', function(test){
tests.push(test);
});
runner.on('fail', function(test){
tests.push(test);
});
@ -3354,7 +3354,7 @@ function XUnit(runner) {
}, false));
tests.forEach(test);
console.log('</testsuite>');
console.log('</testsuite>');
});
}
@ -3615,7 +3615,7 @@ Runnable.prototype.run = function(fn){
}
return;
}
// sync
try {
if (!this.pending) this.fn.call(ctx);
@ -4536,7 +4536,7 @@ exports.indexOf = function(arr, obj, start){
/**
* Array#reduce (<=IE8)
*
*
* @param {Array} array
* @param {Function} fn
* @param {Object} initial value

View File

@ -305,11 +305,11 @@ var START_TO_END = 1;
var END_TO_END = 2;
var END_TO_START = 3;
// 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_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_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){
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;

View File

@ -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
*/
var WebdriverAndHtmlReporter = function(html_reporter){
@ -170,7 +170,7 @@ $(function(){
//get the list of specs and filter it if requested
var specs = specs_list.slice();
//inject spec scripts into the dom
var $body = $('body');
$.each(specs, function(i, spec){
@ -195,4 +195,4 @@ $(function(){
mocha.run();
});
});
});

View File

@ -8,12 +8,12 @@ describe("All the alphabet works n stuff", function(){
});
it("when you enter any char it appears right", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var firstTextElement = inner$("div").first();
// simulate key presses to delete content
firstTextElement.sendkeys('{selectall}'); // select all
firstTextElement.sendkeys('{del}'); // clear the first line

View File

@ -6,22 +6,22 @@ describe("bold button", function(){
});
it("makes text bold on click", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var $firstTextElement = inner$("div").first();
//select this text element
$firstTextElement.sendkeys('{selectall}');
//get the bold button and click it
var $boldButton = chrome$(".buttonicon-bold");
$boldButton.click();
//ace creates a new dom element when you press a button, so just get the first text element again
var $newFirstTextElement = inner$("div").first();
// is there a <b> element now?
var isBold = $newFirstTextElement.find("b").length === 1;

View File

@ -198,9 +198,9 @@ console.log(inner$);
/*
it("Creates N rows, changes height of rows, updates UI by caret key events", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var chrome$ = helper.padChrome$;
var numberOfRows = 50;
//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 originalDivHeight = inner$("div").first().css("height");
@ -211,7 +211,7 @@ console.log(inner$);
}).done(function(){ // Once the DOM has registered the items
inner$("div").each(function(index){ // Randomize the item heights (replicates images / headings etc)
var random = Math.floor(Math.random() * (50)) + 20;
$(this).css("height", random+"px");
$(this).css("height", random+"px");
});
console.log(caretPosition(inner$));
@ -253,7 +253,7 @@ console.log(inner$);
keyEvent(inner$, 33, false, false); // doesn't work
i++;
}
// 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
try{
@ -280,7 +280,7 @@ console.log(inner$);
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
}).done(function(){ // Once the DOM has registered the items
expect(true).to.be(true);
expect(true).to.be(true);
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
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";
}else{
var evtType = "keydown";
@ -310,7 +310,7 @@ function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the win
if(shift){
e.shiftKey = true; // Shift Key
}
e.which = charCode;
e.which = charCode;
e.keyCode = charCode;
target("#innerdocbody").trigger(e);
}

View File

@ -12,7 +12,7 @@ describe("change username value", function(){
//click on the settings button to make settings visible
var $userButton = chrome$(".buttonicon-showusers");
$userButton.click();
var $usernameInput = chrome$("#myusernameedit");
$usernameInput.click();
@ -45,7 +45,7 @@ describe("change username value", function(){
//click on the settings button to make settings visible
var $userButton = chrome$(".buttonicon-showusers");
$userButton.click();
var $usernameInput = chrome$("#myusernameedit");
$usernameInput.click();

View File

@ -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) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var chatValue = "JohnMcLear";
//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) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//click on the chat button to make chat visible
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) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible
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) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings");

View File

@ -1,21 +1,21 @@
describe("chat-load-messages", function(){
var padName;
it("creates a pad", function(done) {
padName = helper.newPad(done);
this.timeout(60000);
});
it("adds a lot of messages", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var chatButton = chrome$("#chaticon");
chatButton.click();
var chatInput = chrome$("#chatinput");
var chatText = chrome$("#chattext");
this.timeout(60000);
var messages = 140;
for(var i=1; i <= messages; i++) {
var num = ''+i;
@ -33,7 +33,7 @@ describe("chat-load-messages", function(){
helper.newPad(done, padName);
});
});
it("checks initial message count", function(done) {
var chatText;
var expectedCount = 101;
@ -48,7 +48,7 @@ describe("chat-load-messages", function(){
done();
});
});
it("loads more messages", function(done) {
var expectedCount = 122;
var chrome$ = helper.padChrome$;
@ -56,7 +56,7 @@ describe("chat-load-messages", function(){
chatButton.click();
var chatText = chrome$("#chattext");
var loadMsgBtn = chrome$("#chatloadmessagesbutton");
loadMsgBtn.click();
helper.waitFor(function(){
return chatText.children("p").length == expectedCount;
@ -65,7 +65,7 @@ describe("chat-load-messages", function(){
done();
});
});
it("checks for button vanishing", function(done) {
var expectedDisplay = 'none';
var chrome$ = helper.padChrome$;

View File

@ -6,8 +6,8 @@ describe("clear authorship colors button", function(){
});
it("makes text clear authorship colors", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// override the confirm dialogue functioon
helper.padChrome$.window.confirm = function(){
@ -19,7 +19,7 @@ describe("clear authorship colors button", function(){
// Get the original text
var originalText = inner$("div").first().text();
// Set some new text
var sentText = "Hello";

View File

@ -6,12 +6,12 @@ describe("delete keystroke", function(){
});
it("makes text delete", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var $firstTextElement = inner$("div").first();
// get the original length of this element
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
var $newFirstTextElement = inner$("div").first();
// get the new length of this element
var newElementLength = $newFirstTextElement.text().length;

View File

@ -16,9 +16,9 @@ describe("embed links", function(){
var $embediFrame = $(embedCode);
//read and check the frame attributes
var width = $embediFrame.attr("width");
var height = $embediFrame.attr("height");
var name = $embediFrame.attr("name");
var width = $embediFrame.attr("width");
var height = $embediFrame.attr("height");
var name = $embediFrame.attr("name");
expect(width).to.be('600');
expect(height).to.be('400');
expect(name).to.be(readonly ? "embed_readonly" : "embed_readwrite");
@ -43,7 +43,7 @@ describe("embed links", function(){
} else {
expect(url).to.be(helper.padChrome$.window.location.href);
}
//check if all parts of the url are like expected
expect(params).to.eql(expectedParams);
}
@ -57,7 +57,7 @@ describe("embed links", function(){
describe("the share link", function(){
it("is the actual pad url", function(done){
var chrome$ = helper.padChrome$;
var chrome$ = helper.padChrome$;
//open share dropdown
chrome$(".buttonicon-embed").click();
@ -73,14 +73,14 @@ describe("embed links", function(){
describe("the embed as iframe code", function(){
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
chrome$(".buttonicon-embed").click();
//get the link of the share field + the actual pad url and compare them
var embedCode = chrome$("#embedinput").val();
checkiFrameCode(embedCode, false)
done();
@ -96,7 +96,7 @@ describe("embed links", function(){
describe("the share link", function(){
it("shows a read only url", function(done){
var chrome$ = helper.padChrome$;
var chrome$ = helper.padChrome$;
//open share dropdown
chrome$(".buttonicon-embed").click();
@ -114,7 +114,7 @@ describe("embed links", function(){
describe("the embed as iframe code", function(){
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
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
var embedCode = chrome$("#embedinput").val();
checkiFrameCode(embedCode, true);
done();
});
});

View File

@ -6,12 +6,12 @@ describe("enter keystroke", function(){
});
it("creates a new line & puts cursor onto a new line", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var $firstTextElement = inner$("div").first();
// get the original string value minus the last char
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
var $newFirstTextElement = inner$("div").first();
helper.waitFor(function(){
return inner$("div").first().text() === "";
}).done(function(){

View File

@ -6,8 +6,8 @@ describe("font select", function(){
});
it("makes text monospace", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//click on the settings button to make settings visible
var $settingsButton = chrome$(".buttonicon-settings");

View File

@ -159,7 +159,7 @@ describe("import functionality", function(){
//<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
//<br>\n')
})
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[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')
})
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')
done()
})
xit("import a pad with ordered lists from html", function(done){
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>'

View File

@ -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')
done()
})
xit("import a pad with indented lists and newlines from html", function(done){
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>'
@ -104,7 +104,7 @@ describe("import indents functionality", function(){
<br>\n')
})
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')
done()
})

View File

@ -6,22 +6,22 @@ describe("italic some text", function(){
});
it("makes text italic using button", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var $firstTextElement = inner$("div").first();
//select this text element
$firstTextElement.sendkeys('{selectall}');
//get the bold button and click it
var $boldButton = chrome$(".buttonicon-italic");
$boldButton.click();
//ace creates a new dom element when you press a button, so just get the first text element again
var $newFirstTextElement = inner$("div").first();
// is there a <i> element now?
var isItalic = $newFirstTextElement.find("i").length === 1;

View File

@ -7,7 +7,7 @@ describe("undo button then redo button", function(){
it("redo some typing with button", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// get the first text element inside the editable space
var $firstTextElement = inner$("div span").first();
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
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";
}else{
var evtType = "keydown";

View File

@ -6,22 +6,22 @@ describe("strikethrough button", function(){
});
it("makes text strikethrough", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var $firstTextElement = inner$("div").first();
//select this text element
$firstTextElement.sendkeys('{selectall}');
//get the strikethrough button and click it
var $strikethroughButton = chrome$(".buttonicon-strikethrough");
$strikethroughButton.click();
//ace creates a new dom element when you press a button, so just get the first text element again
var $newFirstTextElement = inner$("div").first();
// is there a <i> element now?
var isstrikethrough = $newFirstTextElement.find("s").length === 1;

View File

@ -8,7 +8,7 @@ xdescribe("timeslider button takes you to the timeslider of a pad", function(){
it("timeslider contained in URL", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// get the first text element inside the editable space
var $firstTextElement = inner$("div span").first();
var originalValue = $firstTextElement.text(); // get the original value

View File

@ -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) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// make some changes to produce 100 revisions
var revs = 10;
this.timeout(60000);
@ -18,15 +18,15 @@ describe("timeslider", function(){
inner$("div").first().sendkeys('a');
}, 200);
}
setTimeout(function() {
// go to timeslider
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
setTimeout(function() {
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
var $sliderBar = timeslider$('#ui-slider-bar');
var latestContents = timeslider$('#padcontent').text();
// Expect the date and time to be shown
@ -36,17 +36,17 @@ describe("timeslider", function(){
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 45;
$sliderBar.trigger(e);
e = new jQuery.Event('mousedown');
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 40;
$sliderBar.trigger(e);
e = new jQuery.Event('mousedown');
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 50;
$sliderBar.trigger(e);
$sliderBar.trigger('mouseup')
setTimeout(function() {

View File

@ -6,9 +6,9 @@ describe("timeslider", function(){
});
it("loads adds a hundred revisions", function(done) { // passes
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// make some changes to produce 100 revisions
var timePerRev = 900
, revs = 100;
@ -20,15 +20,15 @@ describe("timeslider", function(){
}, timePerRev*i);
}
chrome$('.buttonicon-savedRevision').click();
setTimeout(function() {
// go to timeslider
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
setTimeout(function() {
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
var $sliderBar = timeslider$('#ui-slider-bar');
var latestContents = timeslider$('#padcontent').text();
// Click somewhere on the timeslider
@ -36,17 +36,17 @@ describe("timeslider", function(){
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 45;
$sliderBar.trigger(e);
e = new jQuery.Event('mousedown');
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 40;
$sliderBar.trigger(e);
e = new jQuery.Event('mousedown');
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 50;
$sliderBar.trigger(e);
$sliderBar.trigger('mouseup')
setTimeout(function() {
@ -56,7 +56,7 @@ describe("timeslider", function(){
expect( starIsVisible ).to.eql( true );
done();
}, 1000);
}, 6000);
}, revs*timePerRev);
});
@ -64,9 +64,9 @@ describe("timeslider", function(){
// Disabled as jquery trigger no longer works properly
xit("changes the url when clicking on the timeslider", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// make some changes to produce 7 revisions
var timePerRev = 1000
, revs = 20;
@ -77,24 +77,24 @@ describe("timeslider", function(){
inner$("div").first().sendkeys('a');
}, timePerRev*i);
}
setTimeout(function() {
// go to timeslider
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
setTimeout(function() {
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
var $sliderBar = timeslider$('#ui-slider-bar');
var latestContents = timeslider$('#padcontent').text();
var oldUrl = $('#iframe-container iframe')[0].contentWindow.location.hash;
// Click somewhere on the timeslider
var e = new jQuery.Event('mousedown');
e.clientX = e.pageX = 150;
e.clientY = e.pageY = 60;
$sliderBar.trigger(e);
helper.waitFor(function(){
return $('#iframe-container iframe')[0].contentWindow.location.hash != oldUrl;
}, 6000).always(function(){
@ -105,7 +105,7 @@ describe("timeslider", function(){
}, revs*timePerRev);
});
it("jumps to a revision given in the url", function(done) {
var inner$ = helper.padInner$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
this.timeout(20000);
@ -118,7 +118,7 @@ describe("timeslider", function(){
expect( oldLength ).to.not.eql( 0 );
inner$("div").first().sendkeys('a');
var timeslider$;
// wait for our additional revision to be added
helper.waitFor(function(){
// newLines takes the new lines into account which are strippen when using
@ -131,7 +131,7 @@ describe("timeslider", function(){
}, 6000).always(function() {
// go to timeslider with a specific revision set
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
// wait for the timeslider to be loaded
helper.waitFor(function(){
try {
@ -149,17 +149,17 @@ describe("timeslider", function(){
});
it("checks the export url", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
this.timeout(11000);
inner$("div").first().sendkeys('a');
setTimeout(function() {
// go to timeslider
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
var timeslider$;
var exportLink;
helper.waitFor(function(){
try{
timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;

View File

@ -8,7 +8,7 @@ describe("undo button", function(){
it("undo some typing by clicking undo button", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// get the first text element inside the editable space
var $firstTextElement = inner$("div span").first();
var originalValue = $firstTextElement.text(); // get the original value

View File

@ -6,7 +6,7 @@ describe("assign unordered list", function(){
});
it("insert unordered list text then removes by outdent", function(done){
var inner$ = helper.padInner$;
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
var originalText = inner$("div").first().text();