From d05ce11736c93e533618e9d3b9dfdee3f2d3576e Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 10 Jun 2019 15:59:27 -0700 Subject: [PATCH 1/4] Added trashcan tests. --- tests/mocha/index.html | 1 + tests/mocha/trashcan_test.js | 561 +++++++++++++++++++++++++++++++++++ 2 files changed, 562 insertions(+) create mode 100644 tests/mocha/trashcan_test.js diff --git a/tests/mocha/index.html b/tests/mocha/index.html index 48c0c2e51..735eaa0bc 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -37,6 +37,7 @@ + diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js new file mode 100644 index 000000000..e1dc82256 --- /dev/null +++ b/tests/mocha/trashcan_test.js @@ -0,0 +1,561 @@ +/** + * @license + * Visual Blocks Editor + * + * Copyright 2019 Google Inc. + * https://developers.google.com/blockly/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +suite("Trashcan", function() { + var workspace = { + addChangeListener: function(func) { + this.listener = func; + }, + triggerListener: function(event) { + this.listener(event); + }, + options: { + maxTrashcanContents: Infinity + } + }; + function sendDeleteEvent(xmlString) { + var xml = Blockly.Xml.textToDom(xmlString); + xml = xml.children[0]; + var event = { + type: Blockly.Events.BLOCK_DELETE, + oldXml: xml + }; + workspace.triggerListener(event); + } + + setup(function() { + this.trashcan = new Blockly.Trashcan(workspace); + this.setLidStub = sinon.stub(this.trashcan, 'setLidAngle_'); + }); + teardown(function() { + this.setLidStub.restore(); + this.trashcan = null; + }); + + suite("Events", function() { + test("Delete", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("Non-Delete", function() { + var event = { + type: 'dummy_type' + }; + workspace.triggerListener(event); + chai.assert.equal(this.trashcan.contents_.length, 0); + }); + test("Non-Delete w/ oldXml", function() { + var xml = Blockly.Xml.textToDom( + '' + + ' ' + + '' + ); + xml = xml.children[0]; + var event = { + type: 'dummy_type', + oldXml: xml + }; + workspace.triggerListener(event); + chai.assert.equal(this.trashcan.contents_.length, 0); + }); + test("Shadow Delete", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 0); + }); + }); + suite("Unique Contents", function() { + test("Simple", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("No Coords - Coords", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("Different Coords", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("No ID - ID", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("Different IDs", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + }); + test("No Disabled - Disabled True", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Disabled - Disabled False", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + // TODO: Is this how we want this to work? To the user they appear to + // be the same. + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Disabled", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Editable - Editable True", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + // TODO: Is this how we want this to work? To the user they appear to + // be the same. + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Editable - Editable False", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Editable", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Movable - Movable True", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + // TODO: Is this how we want this to work? To the user they appear to + // be the same. + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Movable - Movable False", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Movable", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Fields - Fields", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' dummy_value' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Field Values", function() { + sendDeleteEvent( + '' + + ' ' + + ' dummy_value1' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' dummy_value2' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Values - Values", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Value Blocks", function() { + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Statements - Statements", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Statement Blocks", function() { + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Next - Next", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Next Blocks", function() { + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Comment - Comment", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' comment_text' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Comment Text", function() { + sendDeleteEvent( + '' + + ' ' + + ' comment_text1' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' comment_text2' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Comment Size", function() { + sendDeleteEvent( + '' + + ' ' + + ' comment_text' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' comment_text' + + ' ' + + '' + ); + // TODO: Is this how we want this to work? The difference is not + // related to the content. + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Comment Pinned", function() { + sendDeleteEvent( + '' + + ' ' + + ' comment_text' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' comment_text' + + ' ' + + '' + ); + // TODO: Is this how we want this to work? The difference is not + // related to the content. + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("No Mutator - Mutator", function() { + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + test("Different Mutator", function() { + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + ' ' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 2); + }); + }); + suite("Max Contents", function() { + test("Max 0", function() { + workspace.options.maxTrashcanContents = 0; + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 0); + workspace.options.maxTrashcanContents = Infinity; + }); + test("Last In First Out", function() { + workspace.options.maxTrashcanContents = 1; + sendDeleteEvent( + '' + + ' ' + + '' + ); + sendDeleteEvent( + '' + + ' ' + + '' + ); + chai.assert.equal(this.trashcan.contents_.length, 1); + chai.assert.equal( + Blockly.Xml.textToDom(this.trashcan.contents_[0]) + .children[0].getAttribute('type'), + 'dummy_type2' + ); + workspace.options.maxTrashcanContents = Infinity; + }); + }); +}); From 6665e46cd130605bb6c9fdf63832dcd62a80c6f4 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 12 Jun 2019 18:12:19 -0700 Subject: [PATCH 2/4] Removed test cases that never actually occure. --- tests/mocha/trashcan_test.js | 125 ----------------------------------- 1 file changed, 125 deletions(-) diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index e1dc82256..7b763ef9f 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -102,19 +102,6 @@ suite("Trashcan", function() { ); chai.assert.equal(this.trashcan.contents_.length, 1); }); - test("No Coords - Coords", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 1); - }); test("Different Coords", function() { sendDeleteEvent( '' + @@ -128,19 +115,6 @@ suite("Trashcan", function() { ); chai.assert.equal(this.trashcan.contents_.length, 1); }); - test("No ID - ID", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 1); - }); test("Different IDs", function() { sendDeleteEvent( '' + @@ -167,49 +141,6 @@ suite("Trashcan", function() { ); chai.assert.equal(this.trashcan.contents_.length, 2); }); - test("No Disabled - Disabled False", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - // TODO: Is this how we want this to work? To the user they appear to - // be the same. - chai.assert.equal(this.trashcan.contents_.length, 2); - }); - test("Different Disabled", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 2); - }); - test("No Editable - Editable True", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - // TODO: Is this how we want this to work? To the user they appear to - // be the same. - chai.assert.equal(this.trashcan.contents_.length, 2); - }); test("No Editable - Editable False", function() { sendDeleteEvent( '' + @@ -223,34 +154,6 @@ suite("Trashcan", function() { ); chai.assert.equal(this.trashcan.contents_.length, 2); }); - test("Different Editable", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 2); - }); - test("No Movable - Movable True", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - // TODO: Is this how we want this to work? To the user they appear to - // be the same. - chai.assert.equal(this.trashcan.contents_.length, 2); - }); test("No Movable - Movable False", function() { sendDeleteEvent( '' + @@ -264,34 +167,6 @@ suite("Trashcan", function() { ); chai.assert.equal(this.trashcan.contents_.length, 2); }); - test("Different Movable", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 2); - }); - test("No Fields - Fields", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' dummy_value' + - ' ' + - '' - ); - chai.assert.equal(this.trashcan.contents_.length, 2); - }); test("Different Field Values", function() { sendDeleteEvent( '' + From 406c6aca76c7498b620cb210dff84488c3ad02d4 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 12 Jun 2019 18:25:44 -0700 Subject: [PATCH 3/4] Changed sendDeleteEvent to append tags. Fixed bad tests. --- tests/mocha/trashcan_test.js | 332 +++++++++++------------------------ 1 file changed, 103 insertions(+), 229 deletions(-) diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 7b763ef9f..51702faf6 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -31,7 +31,7 @@ suite("Trashcan", function() { } }; function sendDeleteEvent(xmlString) { - var xml = Blockly.Xml.textToDom(xmlString); + var xml = Blockly.Xml.textToDom('' + xmlString + ''); xml = xml.children[0]; var event = { type: Blockly.Events.BLOCK_DELETE, @@ -51,11 +51,7 @@ suite("Trashcan", function() { suite("Events", function() { test("Delete", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 1); }); test("Non-Delete", function() { @@ -80,270 +76,170 @@ suite("Trashcan", function() { chai.assert.equal(this.trashcan.contents_.length, 0); }); test("Shadow Delete", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 0); }); }); suite("Unique Contents", function() { test("Simple", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 1); }); test("Different Coords", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 1); }); test("Different IDs", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 1); }); test("No Disabled - Disabled True", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Editable - Editable False", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Movable - Movable False", function() { - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Field Values", function() { sendDeleteEvent( - '' + - ' ' + - ' dummy_value1' + - ' ' + - '' + '' + + ' dummy_value1' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' dummy_value2' + - ' ' + - '' + '' + + ' dummy_value2' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Values - Values", function() { + sendDeleteEvent(''); sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Value Blocks", function() { sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Statements - Statements", function() { + sendDeleteEvent(''); sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Statement Blocks", function() { sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Next - Next", function() { + sendDeleteEvent(''); sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Next Blocks", function() { sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + ' ' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Comment - Comment", function() { + sendDeleteEvent(''); sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' comment_text' + - ' ' + - '' + '' + + ' comment_text' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Comment Text", function() { sendDeleteEvent( - '' + - ' ' + - ' comment_text1' + - ' ' + - '' + '' + + ' comment_text1' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' comment_text2' + - ' ' + - '' + '' + + ' comment_text2' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Comment Size", function() { sendDeleteEvent( - '' + - ' ' + - ' comment_text' + - ' ' + - '' + '' + + ' comment_text' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' comment_text' + - ' ' + - '' + '' + + ' comment_text' + + '' ); // TODO: Is this how we want this to work? The difference is not // related to the content. @@ -351,52 +247,38 @@ suite("Trashcan", function() { }); test("Different Comment Pinned", function() { sendDeleteEvent( - '' + - ' ' + - ' comment_text' + - ' ' + - '' + '' + + ' comment_text' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' comment_text' + - ' ' + - '' + '' + + ' comment_text' + + '' ); // TODO: Is this how we want this to work? The difference is not // related to the content. chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Mutator - Mutator", function() { + sendDeleteEvent(''); sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Mutator", function() { sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + '' ); sendDeleteEvent( - '' + - ' ' + - ' ' + - ' ' + - '' + '' + + ' ' + + '' ); chai.assert.equal(this.trashcan.contents_.length, 2); }); @@ -414,16 +296,8 @@ suite("Trashcan", function() { }); test("Last In First Out", function() { workspace.options.maxTrashcanContents = 1; - sendDeleteEvent( - '' + - ' ' + - '' - ); - sendDeleteEvent( - '' + - ' ' + - '' - ); + sendDeleteEvent(''); + sendDeleteEvent(''); chai.assert.equal(this.trashcan.contents_.length, 1); chai.assert.equal( Blockly.Xml.textToDom(this.trashcan.contents_[0]) From 2463a754db6509358e51c8bf17692e3d53387e79 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 12 Jun 2019 18:36:50 -0700 Subject: [PATCH 4/4] Updated TODO's. --- tests/mocha/trashcan_test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 51702faf6..d1ce4c36b 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -241,8 +241,8 @@ suite("Trashcan", function() { ' comment_text' + '' ); - // TODO: Is this how we want this to work? The difference is not - // related to the content. + // TODO (#2574): These blocks are treated as different, but appear + // identical when the trashcan is opened. chai.assert.equal(this.trashcan.contents_.length, 2); }); test("Different Comment Pinned", function() { @@ -256,8 +256,8 @@ suite("Trashcan", function() { ' comment_text' + '' ); - // TODO: Is this how we want this to work? The difference is not - // related to the content. + // TODO (#2574): These blocks are treated as different, but appear + // identical when the trashcan is opened. chai.assert.equal(this.trashcan.contents_.length, 2); }); test("No Mutator - Mutator", function() {