mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Remove unecessary deprecation warnings stubs
This commit is contained in:
@@ -1176,10 +1176,7 @@ suite('Blocks', function() {
|
||||
// Restored up by call to sinon.restore() in sharedTestTeardown()
|
||||
sinon.stub(this.block, 'isEditable').returns(false);
|
||||
var icon = this.block.getCommentIcon();
|
||||
// TODO(#4186): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
icon.setVisible(true);
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
this.block.setCommentText('test2');
|
||||
chai.assert.equal(this.block.getCommentText(), 'test2');
|
||||
|
||||
@@ -60,10 +60,7 @@ suite('Comments', function() {
|
||||
test('Not Editable', function() {
|
||||
sinon.stub(this.block, 'isEditable').returns(false);
|
||||
|
||||
// TODO(#4186): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
this.comment.setVisible(true);
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
chai.assert.isTrue(this.comment.isVisible());
|
||||
assertNotEditable(this.comment);
|
||||
@@ -76,10 +73,7 @@ suite('Comments', function() {
|
||||
this.comment.setVisible(true);
|
||||
sinon.stub(this.block, 'isEditable').returns(false);
|
||||
|
||||
// TODO(#4186): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
this.comment.updateEditable();
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
chai.assert.isTrue(this.comment.isVisible());
|
||||
assertNotEditable(this.comment);
|
||||
@@ -91,10 +85,7 @@ suite('Comments', function() {
|
||||
test('Not Editable -> Editable', function() {
|
||||
var editableStub = sinon.stub(this.block, 'isEditable').returns(false);
|
||||
|
||||
// TODO(#4186): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
this.comment.setVisible(true);
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
editableStub.returns(true);
|
||||
|
||||
|
||||
@@ -63,10 +63,7 @@ suite('Field Registry', function() {
|
||||
value: 'ok'
|
||||
};
|
||||
|
||||
// TODO(#4197): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
var field = Blockly.fieldRegistry.fromJson(json);
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
chai.assert.isNotNull(field);
|
||||
chai.assert.equal(field.getValue(), 'ok');
|
||||
@@ -91,10 +88,7 @@ suite('Field Registry', function() {
|
||||
value: 'ok'
|
||||
};
|
||||
|
||||
// TODO(#4197): Remove stubbing of deprecation warning after fixing.
|
||||
var deprecationWarnStub = createDeprecationWarningStub();
|
||||
var field = Blockly.fieldRegistry.fromJson(json);
|
||||
deprecationWarnStub.restore();
|
||||
|
||||
chai.assert.isNotNull(field);
|
||||
chai.assert.equal(field.getValue(), 'ok');
|
||||
|
||||
@@ -12,10 +12,6 @@ const {addBlockTypeToCleanup, addMessageToCleanup, createDeprecationWarningStub,
|
||||
suite('Abstract Fields', function() {
|
||||
setup(function() {
|
||||
sharedTestSetup.call(this);
|
||||
// TODO(#4197): Remove stubbing of deprecation warning after fixing.
|
||||
// field.setValue calls trigger a deprecation warning, capture to prevent
|
||||
// console logs.
|
||||
createDeprecationWarningStub();
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
|
||||
Reference in New Issue
Block a user