mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Capture deprecation warnings in tests that have associated bugs (#4314)
This commit is contained in:
@@ -1081,7 +1081,10 @@ 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');
|
||||
|
||||
@@ -55,7 +55,11 @@ 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);
|
||||
assertEventFired(
|
||||
@@ -67,7 +71,11 @@ 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);
|
||||
assertEventFired(
|
||||
@@ -77,7 +85,12 @@ 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);
|
||||
|
||||
this.comment.updateEditable();
|
||||
|
||||
@@ -64,7 +64,11 @@ 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');
|
||||
});
|
||||
@@ -88,7 +92,11 @@ 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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user