mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
chore: apply prefer-const rule fixes in mocha tests (#5682)
This commit is contained in:
@@ -26,7 +26,7 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('One comment', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
chai.assert.equal(this.workspace.getTopComments(true).length, 1);
|
||||
chai.assert.equal(this.workspace.commentDB_['comment id'], comment);
|
||||
@@ -46,7 +46,7 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('After dispose', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
comment.dispose();
|
||||
chai.assert.equal(this.workspace.getTopComments(true).length, 0);
|
||||
@@ -60,7 +60,7 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('One comment', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
chai.assert.equal(this.workspace.getTopComments(false).length, 1);
|
||||
chai.assert.equal(this.workspace.commentDB_['comment id'], comment);
|
||||
@@ -80,7 +80,7 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('After dispose', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
comment.dispose();
|
||||
chai.assert.equal(this.workspace.getTopComments(false).length, 0);
|
||||
@@ -90,7 +90,7 @@ suite('Workspace comment', function() {
|
||||
|
||||
suite('getCommentById', function() {
|
||||
test('Trivial', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
chai.assert.equal(this.workspace.getCommentById(comment.id), comment);
|
||||
});
|
||||
@@ -104,7 +104,7 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('After dispose', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
comment.dispose();
|
||||
chai.assert.isNull(this.workspace.getCommentById(comment.id));
|
||||
@@ -113,7 +113,7 @@ suite('Workspace comment', function() {
|
||||
|
||||
suite('dispose', function() {
|
||||
test('Called twice', function() {
|
||||
let comment = new Blockly.WorkspaceComment(
|
||||
const comment = new Blockly.WorkspaceComment(
|
||||
this.workspace, 'comment text', 0, 0, 'comment id');
|
||||
comment.dispose();
|
||||
// Nothing should go wrong the second time dispose is called.
|
||||
@@ -152,14 +152,14 @@ suite('Workspace comment', function() {
|
||||
});
|
||||
|
||||
test('Initial position', function() {
|
||||
let xy = this.comment.getXY();
|
||||
const xy = this.comment.getXY();
|
||||
chai.assert.equal(xy.x, 0, 'Initial X position');
|
||||
chai.assert.equal(xy.y, 0, 'Initial Y position');
|
||||
});
|
||||
|
||||
test('moveBy', function() {
|
||||
this.comment.moveBy(10, 100);
|
||||
let xy = this.comment.getXY();
|
||||
const xy = this.comment.getXY();
|
||||
chai.assert.equal(xy.x, 10, 'New X position');
|
||||
chai.assert.equal(xy.y, 100, 'New Y position');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user