Include oldCoordinate and oldContents in ws comment event serialization (#4718)

* Include oldCoordinate and oldContent in ws comment event serialization
This commit is contained in:
Monica Kozbial
2021-03-22 08:41:31 -07:00
committed by GitHub
parent a6a34f9311
commit 62dc2ff6fa
2 changed files with 15 additions and 3 deletions

View File

@@ -611,9 +611,10 @@ suite('Events', function() {
];
var workspaceCommentEventTestCases = [
{title: 'Comment change', class: Blockly.Events.CommentChange,
getArgs: (thisObj) => [thisObj.comment, '', 'words'],
getArgs: (thisObj) => [thisObj.comment, 'bar', 'foo'],
getExpectedJson: (thisObj) => ({type: 'comment_change',
commentId: thisObj.comment.id, newContents: 'words'})},
commentId: thisObj.comment.id, oldContents: 'bar',
newContents: 'foo'})},
{title: 'Comment create', class: Blockly.Events.CommentCreate,
getArgs: (thisObj) => [thisObj.comment],
getExpectedJson: (thisObj) => ({type: 'comment_create',
@@ -627,7 +628,7 @@ suite('Events', function() {
{title: 'Comment move', class: Blockly.Events.CommentMove,
getArgs: (thisObj) => [thisObj.comment],
getExpectedJson: (thisObj) => ({type: 'comment_move',
commentId: thisObj.comment.id})},
commentId: thisObj.comment.id, oldCoordinate: '0,0'})},
];
var testSuites = [
{title: 'Variable events', testCases: variableEventTestCases,