jenkins-bot has submitted this change and it was merged.

Change subject: Transaction tests: Assert specific exception messages
......................................................................


Transaction tests: Assert specific exception messages

Also add a test for "Unbalanced set of replace operations found"

Change-Id: Ibf5bc239a96a849f180a6de6fcdd44c959f994dd
---
M tests/dm/ve.dm.TransactionProcessor.test.js
1 file changed, 12 insertions(+), 6 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/dm/ve.dm.TransactionProcessor.test.js 
b/tests/dm/ve.dm.TransactionProcessor.test.js
index 9ad5c40..d3e9bae 100644
--- a/tests/dm/ve.dm.TransactionProcessor.test.js
+++ b/tests/dm/ve.dm.TransactionProcessor.test.js
@@ -162,7 +162,7 @@
                                        ['pushRetain', 1],
                                        ['pushStopAnnotating', 
'invalid-method', bold]
                                ],
-                               exception: Error
+                               exception: /Invalid annotation method/
                        },
                        'annotating branch opening element throws an 
exception': {
                                calls: [
@@ -170,7 +170,7 @@
                                        ['pushRetain', 1],
                                        ['pushStopAnnotating', 'set', bold]
                                ],
-                               exception: Error
+                               exception: /Invalid transaction, cannot 
annotate a non-content element/
                        },
                        'annotating branch closing element throws an 
exception': {
                                calls: [
@@ -179,7 +179,7 @@
                                        ['pushRetain', 1],
                                        ['pushStopAnnotating', 'set', bold]
                                ],
-                               exception: Error
+                               exception: /Invalid transaction, cannot 
annotate a non-content element/
                        },
                        'setting duplicate annotations throws an exception': {
                                calls: [
@@ -188,7 +188,7 @@
                                        ['pushRetain', 1],
                                        ['pushStopAnnotating', 'set', bold]
                                ],
-                               exception: Error
+                               exception: /Invalid transaction, annotation to 
be set is already set/
                        },
                        'removing non-existent annotations throws an 
exception': {
                                calls: [
@@ -197,7 +197,7 @@
                                        ['pushRetain', 1],
                                        ['pushStopAnnotating', 'clear', bold]
                                ],
-                               exception: Error
+                               exception: /Invalid transaction, annotation to 
be cleared is not set/
                        },
                        'changing, removing and adding attributes': {
                                calls: [
@@ -220,7 +220,7 @@
                                        ['pushRetain', 1],
                                        ['pushReplaceElementAttribute', 'foo', 
23, 42]
                                ],
-                               exception: Error
+                               exception: /Invalid element error, cannot set 
attributes on non-element data/
                        },
                        'inserting text': {
                                calls: [
@@ -267,6 +267,12 @@
                                        data.splice( 1, 1, 'F', 'O', 'O', { 
type: 'inlineImage' }, { type: '/inlineImage' }, 'B', 'A', 'R' );
                                }
                        },
+                       'inserting unbalanced data': {
+                               calls: [
+                                       ['pushReplace', 0, 0, [{ type: 'table' 
}]]
+                               ],
+                               exception: /Unbalanced set of replace 
operations found/
+                       },
                        'converting an element': {
                                calls: [
                                        ['pushReplace', 0, 1, [{ type: 
'paragraph' }]],

-- 
To view, visit https://gerrit.wikimedia.org/r/195358
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf5bc239a96a849f180a6de6fcdd44c959f994dd
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to