mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
* chore(deps): bump chai from 5.2.1 to 6.0.1 Bumps [chai](https://github.com/chaijs/chai) from 5.2.1 to 6.0.1. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/v5.2.1...v6.0.1) --- updated-dependencies: - dependency-name: chai dependency-version: 6.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Fix Chai import path. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aaron Dodson <adodson@google.com>
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {assert} from '../../node_modules/chai/index.js';
|
|
import {
|
|
sharedTestSetup,
|
|
sharedTestTeardown,
|
|
} from './test_helpers/setup_teardown.js';
|
|
|
|
suite('Var Delete Event', function () {
|
|
setup(function () {
|
|
sharedTestSetup.call(this);
|
|
this.workspace = new Blockly.Workspace();
|
|
});
|
|
|
|
teardown(function () {
|
|
sharedTestTeardown.call(this);
|
|
});
|
|
|
|
suite('Serialization', function () {
|
|
test('untyped variable events round-trip through JSON', function () {
|
|
const varModel = new Blockly.VariableModel(
|
|
this.workspace,
|
|
'name',
|
|
'',
|
|
'id',
|
|
);
|
|
const origEvent = new Blockly.Events.VarDelete(varModel);
|
|
|
|
const json = origEvent.toJson();
|
|
const newEvent = new Blockly.Events.fromJson(json, this.workspace);
|
|
|
|
assert.deepEqual(newEvent, origEvent);
|
|
});
|
|
|
|
test('typed variable events round-trip through JSON', function () {
|
|
const varModel = new Blockly.VariableModel(
|
|
this.workspace,
|
|
'name',
|
|
'type',
|
|
'id',
|
|
);
|
|
const origEvent = new Blockly.Events.VarDelete(varModel);
|
|
|
|
const json = origEvent.toJson();
|
|
const newEvent = new Blockly.Events.fromJson(json, this.workspace);
|
|
|
|
assert.deepEqual(newEvent, origEvent);
|
|
});
|
|
});
|
|
});
|