jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362378 )
Change subject: build: Upgrade grunt-eslint from 19.0.0 to 20.0.0 ...................................................................... build: Upgrade grunt-eslint from 19.0.0 to 20.0.0 Lots of indent fixes (some of them a little dubious), plus a few unnecessary regex and quote character escapes. Change-Id: I18e13186f34756ca9c75a6e64d7e78baa819c629 --- M package.json M src/ce/keydownhandlers/ve.ce.LinearArrowKeyDownHandler.js M src/ce/keydownhandlers/ve.ce.LinearDeleteKeyDownHandler.js M src/ce/nodes/ve.ce.TableNode.js M src/ce/ve.ce.ResizableNode.js M src/ce/ve.ce.Surface.js M src/ce/ve.ce.TextState.js M src/dm/lineardata/ve.dm.ElementLinearData.js M src/dm/ve.dm.Converter.js M src/dm/ve.dm.IndexValueStore.js M src/dm/ve.dm.MetaList.js M src/dm/ve.dm.Scalable.js M src/dm/ve.dm.TransactionBuilder.js M src/dm/ve.dm.TransactionProcessor.js M src/dm/ve.dm.VisualDiff.js M src/init/sa/ve.init.sa.Platform.js M src/ui/actions/ve.ui.LinkAction.js M src/ui/contextitems/ve.ui.MergeCellsContextItem.js M src/ui/ve.ui.Surface.js M src/ui/widgets/ve.ui.LinkAnnotationWidget.js M src/ui/widgets/ve.ui.MediaSizeWidget.js M src/ve.Filibuster.js M tests/ce/ve.ce.Surface.test.js M tests/dm/ve.dm.RebaseServer.test.js M tests/dm/ve.dm.SurfaceFragment.test.js M tests/init/ve.init.sa.Platform.test.js M tests/ui/ve.ui.DiffElement.test.js M tests/ve.test.js M tests/ve.test.utils.js 29 files changed, 392 insertions(+), 377 deletions(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified Jforrester: Looks good to me, but someone else must approve diff --git a/package.json b/package.json index 9ac2929..6f26448 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "grunt-contrib-watch": "1.0.0", "grunt-css-url-embed": "1.10.0", "grunt-cssjanus": "0.4.0", - "grunt-eslint": "19.0.0", + "grunt-eslint": "20.0.0", "grunt-jsonlint": "1.1.0", "grunt-karma": "2.0.0", "grunt-stylelint": "0.8.0", diff --git a/src/ce/keydownhandlers/ve.ce.LinearArrowKeyDownHandler.js b/src/ce/keydownhandlers/ve.ce.LinearArrowKeyDownHandler.js index df3e3c0..26dd80a 100644 --- a/src/ce/keydownhandlers/ve.ce.LinearArrowKeyDownHandler.js +++ b/src/ce/keydownhandlers/ve.ce.LinearArrowKeyDownHandler.js @@ -186,8 +186,8 @@ } newRange = ( afterDirection > 0 ? - viewNode.getOuterRange() : - viewNode.getOuterRange().flip() + viewNode.getOuterRange() : + viewNode.getOuterRange().flip() ); } else { // Check where the range has moved to diff --git a/src/ce/keydownhandlers/ve.ce.LinearDeleteKeyDownHandler.js b/src/ce/keydownhandlers/ve.ce.LinearDeleteKeyDownHandler.js index 71c9778..6a6d082 100644 --- a/src/ce/keydownhandlers/ve.ce.LinearDeleteKeyDownHandler.js +++ b/src/ce/keydownhandlers/ve.ce.LinearDeleteKeyDownHandler.js @@ -82,8 +82,8 @@ // then preventDefault if ( direction > 0 ? - skipNode.classList.contains( 've-ce-nail-pre-open' ) : - skipNode.classList.contains( 've-ce-nail-post-close' ) + skipNode.classList.contains( 've-ce-nail-pre-open' ) : + skipNode.classList.contains( 've-ce-nail-post-close' ) ) { position = ve.adjacentDomPosition( position, @@ -104,19 +104,19 @@ skipNode.classList && skipNode.classList.contains( direction > 0 ? - 've-ce-nail-pre-close' : - 've-ce-nail-post-open' + 've-ce-nail-pre-close' : + 've-ce-nail-post-open' ) && ( pairNode = ( direction > 0 ? - skipNode.previousSibling : - skipNode.nextSibling + skipNode.previousSibling : + skipNode.nextSibling ) ) && pairNode.classList && pairNode.classList.contains( direction > 0 ? - 've-ce-nail-post-open' : - 've-ce-nail-pre-close' + 've-ce-nail-post-open' : + 've-ce-nail-pre-close' ) ) { linkNode = skipNode.parentNode; @@ -142,8 +142,8 @@ // then preventDefault if ( direction > 0 ? - skipNode.classList.contains( 've-ce-nail-pre-close' ) : - skipNode.classList.contains( 've-ce-nail-post-open' ) + skipNode.classList.contains( 've-ce-nail-pre-close' ) : + skipNode.classList.contains( 've-ce-nail-post-open' ) ) { position = ve.adjacentDomPosition( position, diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js index 03de669..c451f2d 100644 --- a/src/ce/nodes/ve.ce.TableNode.js +++ b/src/ce/nodes/ve.ce.TableNode.js @@ -358,7 +358,8 @@ ve.ce.TableNode.prototype.onSurfaceModelSelect = function ( selection ) { // The table is active if there is a linear selection inside a cell being edited // or a table selection matching this table. - var active = ( + var active = + ( this.editingFragment !== null && selection instanceof ve.dm.LinearSelection && this.editingFragment.getSelection().getRanges()[ 0 ].containsRange( selection.getRange() ) diff --git a/src/ce/ve.ce.ResizableNode.js b/src/ce/ve.ce.ResizableNode.js index 8510fc7..a64ade1 100644 --- a/src/ce/ve.ce.ResizableNode.js +++ b/src/ce/ve.ce.ResizableNode.js @@ -249,16 +249,16 @@ this.$resizeHandles .find( '.ve-ce-resizableNode-neHandle' ) - .css( { marginRight: -this.$resizable.width() } ) - .end() + .css( { marginRight: -this.$resizable.width() } ); + this.$resizeHandles .find( '.ve-ce-resizableNode-swHandle' ) - .css( { marginBottom: -this.$resizable.height() } ) - .end() + .css( { marginBottom: -this.$resizable.height() } ); + this.$resizeHandles .find( '.ve-ce-resizableNode-seHandle' ) - .css( { - marginRight: -this.$resizable.width(), - marginBottom: -this.$resizable.height() - } ); + .css( { + marginRight: -this.$resizable.width(), + marginBottom: -this.$resizable.height() + } ); this.$resizeHandles.children() .off( '.ve-ce-resizableNode' ) @@ -449,16 +449,16 @@ height: 0 } ) .find( '.ve-ce-resizableNode-neHandle' ) - .css( { marginRight: -width } ) - .end() + .css( { marginRight: -width } ); + this.$resizeHandles .find( '.ve-ce-resizableNode-swHandle' ) - .css( { marginBottom: -height } ) - .end() + .css( { marginBottom: -height } ); + this.$resizeHandles .find( '.ve-ce-resizableNode-seHandle' ) - .css( { - marginRight: -width, - marginBottom: -height - } ); + .css( { + marginRight: -width, + marginBottom: -height + } ); }; /** diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js index badfa60..2f6eba5 100644 --- a/src/ce/ve.ce.Surface.js +++ b/src/ce/ve.ce.Surface.js @@ -285,7 +285,7 @@ * @static * @property {HTMLElement} */ -ve.ce.Surface.static.cursorHolderTemplate = ( +ve.ce.Surface.static.cursorHolderTemplate = $( '<div>' ) .addClass( 've-ce-cursorHolder' ) .prop( 'contentEditable', 'true' ) @@ -296,8 +296,7 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1155031 ) $( '<img>' ).addClass( 've-ce-cursorHolder-img' ) ) - .get( 0 ) -); + .get( 0 ); /* Static methods */ @@ -311,12 +310,13 @@ */ ve.ce.Surface.static.getClipboardHash = function ( $elements, beforePasteData ) { beforePasteData = beforePasteData || {}; - return $elements.text().slice( - beforePasteData.leftText ? beforePasteData.leftText.length : 0, - beforePasteData.rightText ? -beforePasteData.rightText.length : undefined - ) - // Whitespace may be modified (e.g. ' ' to ' '), so strip it all - .replace( /\s/gm, '' ); + return $elements.text() + .slice( + beforePasteData.leftText ? beforePasteData.leftText.length : 0, + beforePasteData.rightText ? -beforePasteData.rightText.length : undefined + ) + // Whitespace may be modified (e.g. ' ' to ' '), so strip it all + .replace( /\s/gm, '' ); }; /* Methods */ @@ -648,8 +648,8 @@ // Collapsed selections can have a width of 0, so expand width: Math.max( rects[ i ].width, 1 ), height: rects[ i ].height - } - ) ).toggleClass( 've-ce-surface-deactivatedSelection-collapsed', selection.getModel().isCollapsed() ); + } ) + ).toggleClass( 've-ce-surface-deactivatedSelection-collapsed', selection.getModel().isCollapsed() ); } } } @@ -4049,9 +4049,9 @@ background: color } ).append( $( '<span>' ) - .addClass( 've-ce-surface-highlights-user-cursor-label' ) - .text( this.synchronizer.authorNames[ author ] ) - .css( { background: color } ) + .addClass( 've-ce-surface-highlights-user-cursor-label' ) + .text( this.synchronizer.authorNames[ author ] ) + .css( { background: color } ) ) ); diff --git a/src/ce/ve.ce.TextState.js b/src/ce/ve.ce.TextState.js index ea8350c..7459b31 100644 --- a/src/ce/ve.ce.TextState.js +++ b/src/ce/ve.ce.TextState.js @@ -234,7 +234,7 @@ // annotations, then matching characters at their end potentially form part of // the unchanged end region. if ( oldChunks[ oldChunks.length - 1 - change.end ].hasEqualElements( - newChunks[ newChunks.length - 1 - change.end ] + newChunks[ newChunks.length - 1 - change.end ] ) ) { oldChunk = oldChunks[ oldChunks.length - 1 - change.end ]; newChunk = newChunks[ newChunks.length - 1 - change.end ]; diff --git a/src/dm/lineardata/ve.dm.ElementLinearData.js b/src/dm/lineardata/ve.dm.ElementLinearData.js index 5975c54..73ae828 100644 --- a/src/dm/lineardata/ve.dm.ElementLinearData.js +++ b/src/dm/lineardata/ve.dm.ElementLinearData.js @@ -1191,10 +1191,12 @@ // Create annotation set to remove from blacklist setToRemove = allAnnotations.filter( function ( annotation ) { - return ( rules.blacklist && rules.blacklist.indexOf( annotation.name ) !== -1 ) || ( - // If original DOM element references are being removed, remove spans - annotation.name === 'textStyle/span' && rules.removeOriginalDomElements - ); + return ( + rules.blacklist && rules.blacklist.indexOf( annotation.name ) !== -1 + ) || ( + // If original DOM element references are being removed, remove spans + annotation.name === 'textStyle/span' && rules.removeOriginalDomElements + ); } ); } diff --git a/src/dm/ve.dm.Converter.js b/src/dm/ve.dm.Converter.js index 41206a0..45ca662 100644 --- a/src/dm/ve.dm.Converter.js +++ b/src/dm/ve.dm.Converter.js @@ -579,7 +579,7 @@ if ( wrappedMetaItems[ i ].internal && wrappedMetaItems[ i ].internal.whitespace ) { if ( whitespaceTreatment === 'restore' ) { ve.batchPush( toInsert, ve.dm.Converter.static.getDataContentFromText( - wrappedMetaItems[ i ].internal.whitespace[ 0 ], context.annotations + wrappedMetaItems[ i ].internal.whitespace[ 0 ], context.annotations ) ); delete wrappedMetaItems[ i ].internal; } else if ( whitespaceTreatment === 'fixup' ) { @@ -1431,7 +1431,9 @@ break; case 'empty': // 'empty' elements - first ensure they are actually empty - if ( domElement.childNodes.length === 0 && ( + if ( + domElement.childNodes.length === 0 && + ( // then check that we are the last child // before unwrapping (and therefore destroying) data[ i + 1 ] === undefined || diff --git a/src/dm/ve.dm.IndexValueStore.js b/src/dm/ve.dm.IndexValueStore.js index 08bf153..c413f46 100644 --- a/src/dm/ve.dm.IndexValueStore.js +++ b/src/dm/ve.dm.IndexValueStore.js @@ -152,7 +152,7 @@ return hash; }; - /** +/** * Replace a value's stored hash, e.g. if the value has changed and you want to discard the old one. * * @param {string} oldHash The value's previously stored hash diff --git a/src/dm/ve.dm.MetaList.js b/src/dm/ve.dm.MetaList.js index f4df02a..be8172e 100644 --- a/src/dm/ve.dm.MetaList.js +++ b/src/dm/ve.dm.MetaList.js @@ -174,9 +174,9 @@ // No metadata handling specified, which means we just have to deal with offset // adjustments, same as a retain for ( ; - itemIndex < numItems && - this.items[ itemIndex ].offset < offset + rm.length; - itemIndex++ + itemIndex < numItems && + this.items[ itemIndex ].offset < offset + rm.length; + itemIndex++ ) { newItems.push( { item: this.items[ itemIndex ], diff --git a/src/dm/ve.dm.Scalable.js b/src/dm/ve.dm.Scalable.js index 29d06e1..a48249e 100644 --- a/src/dm/ve.dm.Scalable.js +++ b/src/dm/ve.dm.Scalable.js @@ -519,10 +519,12 @@ * @return {boolean} Current dimensions are greater than maximum dimensions */ ve.dm.Scalable.prototype.isTooSmall = function () { - return !!( this.getCurrentDimensions() && this.getMinDimensions() && ( + return !!( this.getCurrentDimensions() && this.getMinDimensions() && + ( this.getCurrentDimensions().width < this.getMinDimensions().width || this.getCurrentDimensions().height < this.getMinDimensions().height - ) ); + ) + ); }; /** @@ -533,10 +535,12 @@ * @return {boolean} Current dimensions are greater than maximum dimensions */ ve.dm.Scalable.prototype.isTooLarge = function () { - return !!( this.getCurrentDimensions() && this.getMaxDimensions() && ( + return !!( this.getCurrentDimensions() && this.getMaxDimensions() && + ( this.getCurrentDimensions().width > this.getMaxDimensions().width || this.getCurrentDimensions().height > this.getMaxDimensions().height - ) ); + ) + ); }; /** diff --git a/src/dm/ve.dm.TransactionBuilder.js b/src/dm/ve.dm.TransactionBuilder.js index 03a2e7b..1b4cca6 100644 --- a/src/dm/ve.dm.TransactionBuilder.js +++ b/src/dm/ve.dm.TransactionBuilder.js @@ -970,8 +970,8 @@ mergedMetadata ).concat( ( insertMetadata === undefined || isInsertEmpty ) ? - new Array( insert.length - mergedMetadata.length ) : - insertMetadata + new Array( insert.length - mergedMetadata.length ) : + insertMetadata ), insertedDataOffset, insertedDataLength diff --git a/src/dm/ve.dm.TransactionProcessor.js b/src/dm/ve.dm.TransactionProcessor.js index 4cdfb0f..d2d893e 100644 --- a/src/dm/ve.dm.TransactionProcessor.js +++ b/src/dm/ve.dm.TransactionProcessor.js @@ -405,14 +405,14 @@ dataSplices.length === 1 && // The data it removes does not contain openings/closings !new ve.dm.FlatLinearData( - this.document.getStore(), - dataSplices[ 0 ].removedData - ).containsElementData() && + this.document.getStore(), + dataSplices[ 0 ].removedData + ).containsElementData() && // The data it inserts does not contain openings/closings !new ve.dm.FlatLinearData( - this.document.getStore(), - dataSplices[ 0 ].insert - ).containsElementData() + this.document.getStore(), + dataSplices[ 0 ].insert + ).containsElementData() ) { selection = this.document.selectNodes( new ve.Range( diff --git a/src/dm/ve.dm.VisualDiff.js b/src/dm/ve.dm.VisualDiff.js index f7a81bf..c6e2806 100644 --- a/src/dm/ve.dm.VisualDiff.js +++ b/src/dm/ve.dm.VisualDiff.js @@ -332,11 +332,11 @@ linearDiff: null, replacement: replacement, attributeChange: !replacement && !ve.compare( oldNode.getAttributes(), newNode.getAttributes() ) ? - { - oldAttributes: oldNode.getAttributes(), - newAttributes: newNode.getAttributes() - } : - false + { + oldAttributes: oldNode.getAttributes(), + newAttributes: newNode.getAttributes() + } : + false }; continue; @@ -380,11 +380,11 @@ linearDiff: linearDiff, replacement: replacement, attributeChange: !replacement && !ve.compare( oldNode.getAttributes(), newNode.getAttributes() ) ? - { - oldAttributes: oldNode.getAttributes(), - newAttributes: newNode.getAttributes() - } : - false + { + oldAttributes: oldNode.getAttributes(), + newAttributes: newNode.getAttributes() + } : + false }; if ( linearDiff ) { diff --git a/src/init/sa/ve.init.sa.Platform.js b/src/init/sa/ve.init.sa.Platform.js index bf783bf..0f010bb 100644 --- a/src/init/sa/ve.init.sa.Platform.js +++ b/src/init/sa/ve.init.sa.Platform.js @@ -26,8 +26,8 @@ ve.init.Platform.call( this ); // Properties - this.externalLinkUrlProtocolsRegExp = /^https?\:\/\//i; - this.unanchoredExternalLinkUrlProtocolsRegExp = /https?\:\/\//i; + this.externalLinkUrlProtocolsRegExp = /^https?:\/\//i; + this.unanchoredExternalLinkUrlProtocolsRegExp = /https?:\/\//i; this.messagePaths = messagePaths || []; this.parsedMessages = {}; this.userLanguages = [ 'en' ]; diff --git a/src/ui/actions/ve.ui.LinkAction.js b/src/ui/actions/ve.ui.LinkAction.js index c8be7d9..6c829c3 100644 --- a/src/ui/actions/ve.ui.LinkAction.js +++ b/src/ui/actions/ve.ui.LinkAction.js @@ -166,7 +166,7 @@ * stripped from an autolink. */ ve.ui.LinkAction.prototype.getTrailingPunctuation = function () { - return /[,;.:!?)\]\}"'”’»]+$/; + return /[,;.:!?)\]}"'”’»]+$/; }; /** diff --git a/src/ui/contextitems/ve.ui.MergeCellsContextItem.js b/src/ui/contextitems/ve.ui.MergeCellsContextItem.js index 2fbd887..6a928e4 100644 --- a/src/ui/contextitems/ve.ui.MergeCellsContextItem.js +++ b/src/ui/contextitems/ve.ui.MergeCellsContextItem.js @@ -64,8 +64,8 @@ } else { this.editButton.setLabel( isMergeable && selection.isSingleCell() ? - ve.msg( 'visualeditor-table-merge-cells-unmerge' ) : - ve.msg( 'visualeditor-table-merge-cells-merge' ) + ve.msg( 'visualeditor-table-merge-cells-unmerge' ) : + ve.msg( 'visualeditor-table-merge-cells-merge' ) ); } }; diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js index c6c0a23..bcc5103 100644 --- a/src/ui/ve.ui.Surface.js +++ b/src/ui/ve.ui.Surface.js @@ -825,8 +825,8 @@ startOffset: nativeRange.startOffset, endContainer: ( nativeRange.startContainer === nativeRange.endContainer ? - '(=startContainer)' : - ve.serializeNodeDebug( nativeRange.endContainer ) + '(=startContainer)' : + ve.serializeNodeDebug( nativeRange.endContainer ) ), endOffset: nativeRange.endOffset } ); diff --git a/src/ui/widgets/ve.ui.LinkAnnotationWidget.js b/src/ui/widgets/ve.ui.LinkAnnotationWidget.js index 92b07a4..ac103d9 100644 --- a/src/ui/widgets/ve.ui.LinkAnnotationWidget.js +++ b/src/ui/widgets/ve.ui.LinkAnnotationWidget.js @@ -152,8 +152,8 @@ */ ve.ui.LinkAnnotationWidget.prototype.setAnnotation = function ( annotation, fromText ) { if ( ve.compare( - annotation ? annotation.getComparableObject() : {}, - this.annotation ? this.annotation.getComparableObject() : {} + annotation ? annotation.getComparableObject() : {}, + this.annotation ? this.annotation.getComparableObject() : {} ) ) { // No change return this; diff --git a/src/ui/widgets/ve.ui.MediaSizeWidget.js b/src/ui/widgets/ve.ui.MediaSizeWidget.js index 0199562..eea24ca 100644 --- a/src/ui/widgets/ve.ui.MediaSizeWidget.js +++ b/src/ui/widgets/ve.ui.MediaSizeWidget.js @@ -188,8 +188,8 @@ // to support that as well this.setSizeType( isDefault ? - 'default' : - 'custom' + 'default' : + 'custom' ); this.validateDimensions(); }; @@ -356,11 +356,7 @@ this.sizeTypeSelectWidget.getItemFromData( 'default' ).setDisabled( false ); // Call for the set size type according to default or custom settings of the scalable - this.setSizeType( - this.scalable.isDefault() ? - 'default' : - 'custom' - ); + this.setSizeType( this.scalable.isDefault() ? 'default' : 'custom' ); } this.validateDimensions(); }; diff --git a/src/ve.Filibuster.js b/src/ve.Filibuster.js index 8591e43..9cce357 100644 --- a/src/ve.Filibuster.js +++ b/src/ve.Filibuster.js @@ -503,8 +503,9 @@ } else if ( val instanceof ve.dm.Selection ) { return { 've.dm.Selection': val.getDescription() }; } else if ( val.constructor === ve.dm.AnnotationSet ) { - return { 've.dm.AnnotationSet': - val.getStore().values( val.getIndexes() ) + return { + 've.dm.AnnotationSet': val.getStore() + .values( val.getIndexes() ) .map( function ( annotation ) { return annotation.name; } ) diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js index cb53164..a4981a1 100644 --- a/tests/ce/ve.ce.Surface.test.js +++ b/tests/ce/ve.ce.Surface.test.js @@ -330,10 +330,12 @@ rangeOrSelection: new ve.Range( 0, 63 ), keys: [ 'BACKSPACE' ], expectedData: function ( data ) { - data.splice( 0, 61, - { type: 'paragraph' }, - { type: '/paragraph' } - ); + data.splice( + 0, + 61, + { type: 'paragraph' }, + { type: '/paragraph' } + ); }, expectedRangeOrSelection: new ve.Range( 1 ), msg: 'Backspace after select all spanning entire document creates empty paragraph' diff --git a/tests/dm/ve.dm.RebaseServer.test.js b/tests/dm/ve.dm.RebaseServer.test.js index abffd10..4b8c554 100644 --- a/tests/dm/ve.dm.RebaseServer.test.js +++ b/tests/dm/ve.dm.RebaseServer.test.js @@ -7,273 +7,274 @@ QUnit.module( 've.dm.RebaseServer' ); QUnit.test( 'Rebase', function ( assert ) { - var cases = [ - { - name: 'Concurrent insertions', - initialData: [ { type: 'paragraph' }, { type: '/paragraph' } ], - clients: [ '1', '2' ], - ops: [ - // Client 1 submits abc - [ '1', 'apply', [ - [ 'insert', 1, [ 'a' ], 3 ], - [ 'insert', 2, [ 'b' ], 3 ], - [ 'insert', 3, [ 'c' ], 3 ] - ] ], - // Client getHistorySummary() output looks like: confirmed/sent?/unsent! - // Obviously, the server only has confirmed items - [ '1', 'assertHist', 'abc!' ], - [ '1', 'submit' ], - [ '1', 'assertHist', 'abc?' ], - [ '1', 'deliver' ], - [ 'server', 'assertHist', 'abc' ], + var i, j, op, server, client, clients, action, txs, + cases = [ + { + name: 'Concurrent insertions', + initialData: [ { type: 'paragraph' }, { type: '/paragraph' } ], + clients: [ '1', '2' ], + ops: [ + // Client 1 submits abc + [ '1', 'apply', [ + [ 'insert', 1, [ 'a' ], 3 ], + [ 'insert', 2, [ 'b' ], 3 ], + [ 'insert', 3, [ 'c' ], 3 ] + ] ], + // Client getHistorySummary() output looks like: confirmed/sent?/unsent! + // Obviously, the server only has confirmed items + [ '1', 'assertHist', 'abc!' ], + [ '1', 'submit' ], + [ '1', 'assertHist', 'abc?' ], + [ '1', 'deliver' ], + [ 'server', 'assertHist', 'abc' ], - // Client 2 submits AB - [ '2', 'apply', [ - [ 'insert', 1, [ 'A' ], 3 ], - [ 'insert', 2, [ 'B' ], 3 ] - ] ], - [ '2', 'assertHist', 'AB!' ], - [ '2', 'submit' ], - [ '2', 'deliver' ], - // Server puts client 2's insertion after client 1's - [ 'server', 'assertHist', 'abcAB' ], + // Client 2 submits AB + [ '2', 'apply', [ + [ 'insert', 1, [ 'A' ], 3 ], + [ 'insert', 2, [ 'B' ], 3 ] + ] ], + [ '2', 'assertHist', 'AB!' ], + [ '2', 'submit' ], + [ '2', 'deliver' ], + // Server puts client 2's insertion after client 1's + [ 'server', 'assertHist', 'abcAB' ], - // Client 1 inserts bolded def - [ '1', 'apply', [ - [ 'insert', 4, [ 'd', 'e', 'f' ], 3 ] - ] ], - [ '1', 'assertHist', 'abc?/def!' ], - // Client 1 receives confirmation of abc - [ '1', 'receive' ], - [ '1', 'assertHist', 'abc/def!' ], - // Client 1 submits def - [ '1', 'submit' ], - [ '1', 'assertHist', 'abc/def?' ], - [ '1', 'deliver' ], - // The summary order shows that def arrived after AB in the - // history (even though it lies before AB in document order) - [ 'server', 'assertHist', 'abcABdef' ], + // Client 1 inserts bolded def + [ '1', 'apply', [ + [ 'insert', 4, [ 'd', 'e', 'f' ], 3 ] + ] ], + [ '1', 'assertHist', 'abc?/def!' ], + // Client 1 receives confirmation of abc + [ '1', 'receive' ], + [ '1', 'assertHist', 'abc/def!' ], + // Client 1 submits def + [ '1', 'submit' ], + [ '1', 'assertHist', 'abc/def?' ], + [ '1', 'deliver' ], + // The summary order shows that def arrived after AB in the + // history (even though it lies before AB in document order) + [ 'server', 'assertHist', 'abcABdef' ], - // Client 2 inserts underlined CD - [ '2', 'apply', [ - [ 'insert', 3, [ 'C', 'D' ], 3 ] - ] ], - [ '2', 'assertHist', 'AB?/CD!' ], - // Client 2 receives abc and rebases over it - [ '2', 'receive' ], - [ '2', 'assertHist', 'abc/AB?/CD!' ], - // Client 2 receives confirmation of AB - [ '2', 'receive' ], - [ '2', 'assertHist', 'abcAB/CD!' ], - // Client 2 submits CD - [ '2', 'submit' ], - [ '2', 'assertHist', 'abcAB/CD?' ], - [ '2', 'deliver' ], - [ 'server', 'assertHist', 'abcABdefCD' ], + // Client 2 inserts underlined CD + [ '2', 'apply', [ + [ 'insert', 3, [ 'C', 'D' ], 3 ] + ] ], + [ '2', 'assertHist', 'AB?/CD!' ], + // Client 2 receives abc and rebases over it + [ '2', 'receive' ], + [ '2', 'assertHist', 'abc/AB?/CD!' ], + // Client 2 receives confirmation of AB + [ '2', 'receive' ], + [ '2', 'assertHist', 'abcAB/CD!' ], + // Client 2 submits CD + [ '2', 'submit' ], + [ '2', 'assertHist', 'abcAB/CD?' ], + [ '2', 'deliver' ], + [ 'server', 'assertHist', 'abcABdefCD' ], - // Client 1 receives AB, rebases def over it - [ '1', 'receive' ], - [ '1', 'assertHist', 'abcAB/def?' ], - // Client 1 receives confirmation of def - [ '1', 'receive' ], - [ '1', 'assertHist', 'abcABdef' ], + // Client 1 receives AB, rebases def over it + [ '1', 'receive' ], + [ '1', 'assertHist', 'abcAB/def?' ], + // Client 1 receives confirmation of def + [ '1', 'receive' ], + [ '1', 'assertHist', 'abcABdef' ], - // Client 1 submits ghi - [ '1', 'apply', [ - [ 'insert', 9, [ 'g', 'h', 'i' ], 3 ] - ] ], - [ '1', 'assertHist', 'abcABdef/ghi!' ], - [ '1', 'submit' ], - [ '1', 'assertHist', 'abcABdef/ghi?' ], - [ '1', 'deliver' ], - [ 'server', 'assertHist', 'abcABdefCDghi' ], - // Client 1 receives CD, rebases ghi over it - [ '1', 'receive' ], - [ '1', 'assertHist', 'abcABdefCD/ghi?' ], - // Client 1 receives confirmation of ghi - [ '1', 'receive' ], - [ '1', 'assertHist', 'abcABdefCDghi' ], + // Client 1 submits ghi + [ '1', 'apply', [ + [ 'insert', 9, [ 'g', 'h', 'i' ], 3 ] + ] ], + [ '1', 'assertHist', 'abcABdef/ghi!' ], + [ '1', 'submit' ], + [ '1', 'assertHist', 'abcABdef/ghi?' ], + [ '1', 'deliver' ], + [ 'server', 'assertHist', 'abcABdefCDghi' ], + // Client 1 receives CD, rebases ghi over it + [ '1', 'receive' ], + [ '1', 'assertHist', 'abcABdefCD/ghi?' ], + // Client 1 receives confirmation of ghi + [ '1', 'receive' ], + [ '1', 'assertHist', 'abcABdefCDghi' ], - // Client 2 catches up - [ '2', 'receive' ], - [ '2', 'assertHist', 'abcABdef/CD?' ], - [ '2', 'receive' ], - [ '2', 'assertHist', 'abcABdefCD' ], - [ '2', 'receive' ], - [ '2', 'assertHist', 'abcABdefCDghi' ] - ] - }, - { - name: 'Conflicting deletions', - initialData: [ - { type: 'paragraph' }, - 'a', 'b', 'c', 'A', 'B', 'd', 'e', 'f', 'C', 'D', 'g', 'h', 'i', - { type: '/paragraph' } - ], - clients: [ '1', '2' ], - ops: [ - // Client 1 delivers one deletion and leaves another one in the pipeline - [ '1', 'apply', [ - [ 'remove', 5, 2, 10 ] - ] ], - [ '1', 'assertHist', '-(Bd)!' ], - [ '1', 'submit' ], - [ '1', 'assertHist', '-(Bd)?' ], - [ '1', 'apply', [ - [ 'remove', 3, 2, 10 ] - ] ], - [ '1', 'assertHist', '-(Bd)?/-(cA)!' ], - [ '1', 'submit' ], - [ '1', 'assertHist', '-(Bd)-(cA)?' ], - [ '1', 'deliver' ], - [ 'server', 'assertHist', '-(Bd)' ], - [ '1', 'receive' ], - [ '1', 'assertHist', '-(Bd)/-(cA)?' ], + // Client 2 catches up + [ '2', 'receive' ], + [ '2', 'assertHist', 'abcABdef/CD?' ], + [ '2', 'receive' ], + [ '2', 'assertHist', 'abcABdefCD' ], + [ '2', 'receive' ], + [ '2', 'assertHist', 'abcABdefCDghi' ] + ] + }, + { + name: 'Conflicting deletions', + initialData: [ + { type: 'paragraph' }, + 'a', 'b', 'c', 'A', 'B', 'd', 'e', 'f', 'C', 'D', 'g', 'h', 'i', + { type: '/paragraph' } + ], + clients: [ '1', '2' ], + ops: [ + // Client 1 delivers one deletion and leaves another one in the pipeline + [ '1', 'apply', [ + [ 'remove', 5, 2, 10 ] + ] ], + [ '1', 'assertHist', '-(Bd)!' ], + [ '1', 'submit' ], + [ '1', 'assertHist', '-(Bd)?' ], + [ '1', 'apply', [ + [ 'remove', 3, 2, 10 ] + ] ], + [ '1', 'assertHist', '-(Bd)?/-(cA)!' ], + [ '1', 'submit' ], + [ '1', 'assertHist', '-(Bd)-(cA)?' ], + [ '1', 'deliver' ], + [ 'server', 'assertHist', '-(Bd)' ], + [ '1', 'receive' ], + [ '1', 'assertHist', '-(Bd)/-(cA)?' ], - // Client 2 applies a partially-conflicting change - [ '2', 'apply', [ - [ 'insert', 1, [ 'W' ], 16 ], - // Conflicts with undelivered deletion of 'cA' - [ 'insert', 5, [ 'X' ], 13 ], - // Conflicts with delivered deletion of 'Bd' - [ 'insert', 8, [ 'Y' ], 11 ], - [ 'insert', 12, [ 'Z' ], 8 ] - ] ], - [ '2', 'assertHist', 'WXYZ!' ], - [ '2', 'submit' ], - [ '2', 'assertHist', 'WXYZ?' ], - [ '2', 'receive' ], - // Y conflicts with -(Bd), so Y and Z are discarded - [ '2', 'assertHist', '-(Bd)/WX?' ], + // Client 2 applies a partially-conflicting change + [ '2', 'apply', [ + [ 'insert', 1, [ 'W' ], 16 ], + // Conflicts with undelivered deletion of 'cA' + [ 'insert', 5, [ 'X' ], 13 ], + // Conflicts with delivered deletion of 'Bd' + [ 'insert', 8, [ 'Y' ], 11 ], + [ 'insert', 12, [ 'Z' ], 8 ] + ] ], + [ '2', 'assertHist', 'WXYZ!' ], + [ '2', 'submit' ], + [ '2', 'assertHist', 'WXYZ?' ], + [ '2', 'receive' ], + // Y conflicts with -(Bd), so Y and Z are discarded + [ '2', 'assertHist', '-(Bd)/WX?' ], - // Client 2 applies a "doomed" change built on top of a change that will conflict - [ '2', 'apply', [ - [ 'insert', 1, [ 'V' ], 18 ] - ] ], - [ '2', 'assertHist', '-(Bd)/WX?/V!' ], - [ '2', 'submit' ], - [ '2', 'assertHist', '-(Bd)/WXV?' ], + // Client 2 applies a "doomed" change built on top of a change that will conflict + [ '2', 'apply', [ + [ 'insert', 1, [ 'V' ], 18 ] + ] ], + [ '2', 'assertHist', '-(Bd)/WX?/V!' ], + [ '2', 'submit' ], + [ '2', 'assertHist', '-(Bd)/WXV?' ], - // Client 1 delivers -(cA) - [ '1', 'deliver' ], - [ 'server', 'assertHist', '-(Bd)-(cA)' ], - // Client 2 delivers W (accepted) and X (rejected) - [ '2', 'deliver' ], - [ '2', 'deliver' ], - [ 'server', 'assertHist', '-(Bd)-(cA)W' ], - // Client 2 receives -(cA), discards X and V - [ '2', 'receive' ], - [ '2', 'assertHist', '-(Bd)-(cA)/W?' ], + // Client 1 delivers -(cA) + [ '1', 'deliver' ], + [ 'server', 'assertHist', '-(Bd)-(cA)' ], + // Client 2 delivers W (accepted) and X (rejected) + [ '2', 'deliver' ], + [ '2', 'deliver' ], + [ 'server', 'assertHist', '-(Bd)-(cA)W' ], + // Client 2 receives -(cA), discards X and V + [ '2', 'receive' ], + [ '2', 'assertHist', '-(Bd)-(cA)/W?' ], - // Client 2 inserts and submits P, server accepts - [ '2', 'apply', [ - [ 'insert', 1, [ 'P' ], 16 ] - ] ], - [ '2', 'assertHist', '-(Bd)-(cA)/W?/P!' ], - [ '2', 'submit' ], - [ '2', 'assertHist', '-(Bd)-(cA)/WP?' ], - [ '2', 'deliver' ], - [ 'server', 'assertHist', '-(Bd)-(cA)WP' ], + // Client 2 inserts and submits P, server accepts + [ '2', 'apply', [ + [ 'insert', 1, [ 'P' ], 16 ] + ] ], + [ '2', 'assertHist', '-(Bd)-(cA)/W?/P!' ], + [ '2', 'submit' ], + [ '2', 'assertHist', '-(Bd)-(cA)/WP?' ], + [ '2', 'deliver' ], + [ 'server', 'assertHist', '-(Bd)-(cA)WP' ], - // Client 2 receives confirmation of W and P - [ '2', 'receive' ], - [ '2', 'assertHist', '-(Bd)-(cA)W/P?' ], - [ '2', 'receive' ], - [ '2', 'assertHist', '-(Bd)-(cA)WP' ] - ] - }, - { - name: 'Double client-side rebase with annotation', - initialData: [ - { type: 'paragraph' }, - { type: '/paragraph' }, - { type: 'internalList' }, - { type: '/internalList' } - ], - clients: [ '1', '2' ], - ops: [ - // Client 1 applies a local change that introduces an annotation - [ '1', 'apply', { - start: 0, - transactions: [ - { - operations: [ - { type: 'retain', length: 1 }, - { type: 'replace', remove: [], insert: [ - [ 'X', [ 'h123' ] ], - [ 'Y', [ 'h123' ] ], - [ 'Z', [ 'h123' ] ] - ] }, - { type: 'retain', length: 3 } - ], - author: '1' - } - ], - stores: [ - { - hashes: [ 'h123' ], - hashStore: { - h123: { - type: 'annotation', - value: { - type: 'textStyle/bold' + // Client 2 receives confirmation of W and P + [ '2', 'receive' ], + [ '2', 'assertHist', '-(Bd)-(cA)W/P?' ], + [ '2', 'receive' ], + [ '2', 'assertHist', '-(Bd)-(cA)WP' ] + ] + }, + { + name: 'Double client-side rebase with annotation', + initialData: [ + { type: 'paragraph' }, + { type: '/paragraph' }, + { type: 'internalList' }, + { type: '/internalList' } + ], + clients: [ '1', '2' ], + ops: [ + // Client 1 applies a local change that introduces an annotation + [ '1', 'apply', { + start: 0, + transactions: [ + { + operations: [ + { type: 'retain', length: 1 }, + { type: 'replace', remove: [], insert: [ + [ 'X', [ 'h123' ] ], + [ 'Y', [ 'h123' ] ], + [ 'Z', [ 'h123' ] ] + ] }, + { type: 'retain', length: 3 } + ], + author: '1' + } + ], + stores: [ + { + hashes: [ 'h123' ], + hashStore: { + h123: { + type: 'annotation', + value: { + type: 'textStyle/bold' + } } } } - } - ], - selections: { - 1: { - type: 'linear', - range: { - type: 'range', - from: 4, - to: 4 + ], + selections: { + 1: { + type: 'linear', + range: { + type: 'range', + from: 4, + to: 4 + } } } - } - } ], - [ '1', 'assert', function ( assert, client ) { - var unsubmitted = client.getChangeSince( client.sentLength, false ); - assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is in the store' ); - } ], + } ], + [ '1', 'assert', function ( assert, client ) { + var unsubmitted = client.getChangeSince( client.sentLength, false ); + assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is in the store' ); + } ], - // Client 2 submits two changes - [ '2', 'apply', [ - [ 'insert', 1, [ 'a' ], 3 ] - ] ], - [ '2', 'submit' ], - [ '2', 'apply', [ - [ 'insert', 2, [ 'b' ], 3 ] - ] ], - [ '2', 'submit' ], + // Client 2 submits two changes + [ '2', 'apply', [ + [ 'insert', 1, [ 'a' ], 3 ] + ] ], + [ '2', 'submit' ], + [ '2', 'apply', [ + [ 'insert', 2, [ 'b' ], 3 ] + ] ], + [ '2', 'submit' ], - // Client 1 rebases its local change twice - [ '2', 'deliver' ], - [ 'server', 'assertHist', 'a' ], - [ '1', 'receive' ], - [ '1', 'assertHist', 'a/XYZ!' ], - [ '1', 'assert', function ( assert, client ) { - var unsubmitted = client.getChangeSince( client.sentLength, false ); - assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is still in the store after the first rebase' ); - } ], + // Client 1 rebases its local change twice + [ '2', 'deliver' ], + [ 'server', 'assertHist', 'a' ], + [ '1', 'receive' ], + [ '1', 'assertHist', 'a/XYZ!' ], + [ '1', 'assert', function ( assert, client ) { + var unsubmitted = client.getChangeSince( client.sentLength, false ); + assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is still in the store after the first rebase' ); + } ], - [ '2', 'deliver' ], - [ 'server', 'assertHist', 'ab' ], - [ '1', 'receive' ], - [ '1', 'assertHist', 'ab/XYZ!' ], - [ '1', 'assert', function ( assert, client ) { - var unsubmitted = client.getChangeSince( client.sentLength, false ); - assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is still in the store after the second rebase' ); - } ], + [ '2', 'deliver' ], + [ 'server', 'assertHist', 'ab' ], + [ '1', 'receive' ], + [ '1', 'assertHist', 'ab/XYZ!' ], + [ '1', 'assert', function ( assert, client ) { + var unsubmitted = client.getChangeSince( client.sentLength, false ); + assert.deepEqual( unsubmitted.stores[ 0 ].hashes, [ 'h123' ], 'h123 is still in the store after the second rebase' ); + } ], - // Client 1 submits its local change - [ '1', 'submit' ], - [ '1', 'deliver' ], - [ 'server', 'assertHist', 'abXYZ' ] - ] - } ], - i, j, op, server, client, clients, action, txs; + // Client 1 submits its local change + [ '1', 'submit' ], + [ '1', 'deliver' ], + [ 'server', 'assertHist', 'abXYZ' ] + ] + } + ]; function makeTransaction( doc, data ) { var i, method, diff --git a/tests/dm/ve.dm.SurfaceFragment.test.js b/tests/dm/ve.dm.SurfaceFragment.test.js index e716dff..31a8ec3 100644 --- a/tests/dm/ve.dm.SurfaceFragment.test.js +++ b/tests/dm/ve.dm.SurfaceFragment.test.js @@ -414,10 +414,12 @@ range: new ve.Range( 0, 63 ), directionAfterRemove: -1, expectedData: function ( data ) { - data.splice( 0, 61, - { type: 'paragraph' }, - { type: '/paragraph' } - ); + data.splice( + 0, + 61, + { type: 'paragraph' }, + { type: '/paragraph' } + ); }, expectedRange: new ve.Range( 1 ), msg: 'Backspace after select all spanning entire document creates empty paragraph' @@ -427,10 +429,12 @@ range: new ve.Range( 0, 6 ), directionAfterRemove: -1, expectedData: function ( data ) { - data.splice( 0, 7, - { type: 'paragraph' }, - { type: '/paragraph' } - ); + data.splice( + 0, + 7, + { type: 'paragraph' }, + { type: '/paragraph' } + ); }, expectedRange: new ve.Range( 1 ), msg: 'Delete all when document starts with a focusable node' @@ -440,10 +444,12 @@ range: new ve.Range( 0, 9 ), directionAfterRemove: -1, expectedData: function ( data ) { - data.splice( 0, 9, - { type: 'paragraph' }, - { type: '/paragraph' } - ); + data.splice( + 0, + 9, + { type: 'paragraph' }, + { type: '/paragraph' } + ); }, expectedRange: new ve.Range( 1 ), msg: 'Delete all when document starts and ends with a focusable node' diff --git a/tests/init/ve.init.sa.Platform.test.js b/tests/init/ve.init.sa.Platform.test.js index bdc2fdd..177f477 100644 --- a/tests/init/ve.init.sa.Platform.test.js +++ b/tests/init/ve.init.sa.Platform.test.js @@ -75,7 +75,7 @@ return platform.getInitializedPromise().then( function () { assert.ok( - /^<?platformtest-foo\>?$/.test( platform.getMessage( 'platformtest-foo' ) ), + /^<?platformtest-foo>?$/.test( platform.getMessage( 'platformtest-foo' ) ), 'return plain key as fallback, possibly wrapped in brackets' ); @@ -97,7 +97,7 @@ ); assert.ok( - /^<?platformtest-quux\>?$/.test( platform.getMessage( 'platformtest-quux' ) ), + /^<?platformtest-quux>?$/.test( platform.getMessage( 'platformtest-quux' ) ), 'return plain key as fallback, possibly wrapped in brackets (after set up)' ); } ); diff --git a/tests/ui/ve.ui.DiffElement.test.js b/tests/ui/ve.ui.DiffElement.test.js index e88e64f..9622ba7 100644 --- a/tests/ui/ve.ui.DiffElement.test.js +++ b/tests/ui/ve.ui.DiffElement.test.js @@ -261,9 +261,9 @@ '<div class="ve-ui-diffElement-doc-child-change">' + '<table><tbody>' + '<tr><td>A</td>' + - '<td data-diff-action="structural-insert"><p data-diff-action=\"insert\">B</p></td></tr>' + + '<td data-diff-action="structural-insert"><p data-diff-action="insert">B</p></td></tr>' + '<tr><td>C</td>' + - '<td data-diff-action="structural-insert"><p data-diff-action=\"insert\">D</p></td></tr>' + + '<td data-diff-action="structural-insert"><p data-diff-action="insert">D</p></td></tr>' + '</tbody></table>' + '</div>' }, @@ -274,8 +274,8 @@ expected: '<div class="ve-ui-diffElement-doc-child-change">' + '<table><tbody>' + - '<tr><td>A</td><td data-diff-action="structural-remove"><p data-diff-action=\"remove\">B</p></td></tr>' + - '<tr><td>C</td><td data-diff-action="structural-remove"><p data-diff-action=\"remove\">D</p></td></tr>' + + '<tr><td>A</td><td data-diff-action="structural-remove"><p data-diff-action="remove">B</p></td></tr>' + + '<tr><td>C</td><td data-diff-action="structural-remove"><p data-diff-action="remove">D</p></td></tr>' + '</tbody></table>' + '</div>' }, @@ -295,9 +295,9 @@ '<table><tbody>' + '<tr><td>A</td><td>B</td><td><del data-diff-action="remove">C</del><ins data-diff-action="insert">X</ins></td></tr>' + '<tr data-diff-action="structural-remove">' + - '<td data-diff-action="structural-remove"><p data-diff-action=\"remove\">D</p></td>' + - '<td data-diff-action="structural-remove"><p data-diff-action=\"remove\">E</p></td>' + - '<td data-diff-action="structural-remove"><p data-diff-action=\"remove\">F</p></td>' + + '<td data-diff-action="structural-remove"><p data-diff-action="remove">D</p></td>' + + '<td data-diff-action="structural-remove"><p data-diff-action="remove">E</p></td>' + + '<td data-diff-action="structural-remove"><p data-diff-action="remove">F</p></td>' + '</tr>' + '<tr><td>G</td><td>H</td><td><del data-diff-action="remove">I</del><ins data-diff-action="insert">Y</ins></td></tr>' + '</tbody></table>' + @@ -391,7 +391,7 @@ '<div class="ve-ui-diffElement-doc-child-change">' + '<ul>' + '<li><p>foo</p></li>' + - '<li data-diff-action=\"structural-insert\"><p data-diff-action=\"insert\">bar</p></li>' + + '<li data-diff-action="structural-insert"><p data-diff-action="insert">bar</p></li>' + '<li><p>baz</p></li>' + '</ul>' + '</div>' @@ -404,7 +404,7 @@ '<div class="ve-ui-diffElement-doc-child-change">' + '<ul>' + '<li><p>foo</p></li>' + - '<li data-diff-action=\"structural-remove\"><p data-diff-action=\"remove\">bar</p></li>' + + '<li data-diff-action="structural-remove"><p data-diff-action="remove">bar</p></li>' + '<li><p>baz</p></li>' + '</ul>' + '</div>' @@ -415,8 +415,8 @@ newDoc: '<ul><li><ul><li><p>foo</p></li></ul></li></ul>', expected: '<div class="ve-ui-diffElement-doc-child-change">' + - '<ul data-diff-action=\"structural-insert\">' + - '<li data-diff-action=\"structural-insert\"><ul><li><p>foo</p></li></ul></li>' + + '<ul data-diff-action="structural-insert">' + + '<li data-diff-action="structural-insert"><ul><li><p>foo</p></li></ul></li>' + '</ul>' + '</div>' }, diff --git a/tests/ve.test.js b/tests/ve.test.js index 77958ed..05ccba4 100644 --- a/tests/ve.test.js +++ b/tests/ve.test.js @@ -1090,8 +1090,8 @@ offsetPaths, ( direction === 'backward' ? - test.expectedOffsetPaths.slice().reverse() : - test.expectedOffsetPaths + test.expectedOffsetPaths.slice().reverse() : + test.expectedOffsetPaths ), test.title + ' (' + direction + ')' ); diff --git a/tests/ve.test.utils.js b/tests/ve.test.utils.js index e0ee772..f77434c 100644 --- a/tests/ve.test.utils.js +++ b/tests/ve.test.utils.js @@ -21,8 +21,8 @@ DummyPlatform.prototype.getMessage = function () { return Array.prototype.join.call( arguments, ',' ); }; DummyPlatform.prototype.getLanguageName = function ( lang ) { return 'langname-' + lang; }; DummyPlatform.prototype.getLanguageDirection = function () { return 'ltr'; }; - DummyPlatform.prototype.getExternalLinkUrlProtocolsRegExp = function () { return /^https?\:\/\//i; }; - DummyPlatform.prototype.getUnanchoredExternalLinkUrlProtocolsRegExp = function () { return /https?\:\/\//i; }; + DummyPlatform.prototype.getExternalLinkUrlProtocolsRegExp = function () { return /^https?:\/\//i; }; + DummyPlatform.prototype.getUnanchoredExternalLinkUrlProtocolsRegExp = function () { return /https?:\/\//i; }; DummyPlatform.prototype.getUserConfig = function () { return undefined; }; DummyPlatform.prototype.setUserConfig = function () {}; @@ -376,8 +376,8 @@ */ ve.test.utils.selectionFromRangeOrSelection = function ( doc, rangeOrSelection ) { return rangeOrSelection instanceof ve.Range ? - new ve.dm.LinearSelection( doc, rangeOrSelection ) : - ve.dm.Selection.static.newFromJSON( doc, rangeOrSelection ); + new ve.dm.LinearSelection( doc, rangeOrSelection ) : + ve.dm.Selection.static.newFromJSON( doc, rangeOrSelection ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/362378 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18e13186f34756ca9c75a6e64d7e78baa819c629 Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: DLynch <dly...@wikimedia.org> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits