Commit Graph

27 Commits

Author SHA1 Message Date
Rachel Fenichel
52c0427d85 chore: run eslint--fix for no-var rule in tests/mocha (#5637) 2021-10-25 11:37:23 -07:00
Beka Westberg
e954193009 fix: project cereal cleanup (#5398)
* fix: make exception constructors package

* fix: rename blocks.load to blocks.append

* fix: inline docs

* fix: consistency in block serialization

* fix: remove unexported functions

* fix: interface requires

* fix: tag TODO with issue number
2021-09-20 13:08:35 -07:00
Beka Westberg
0e0c5fea0e fix: dragging variables from flyout (#5434)
* fix: dragging variables from flyout

* fix: rename positionBlock_ to positionNewBlock_

* fix: type

* fix: try alternative method for handling variables in flyout
2021-09-20 13:08:35 -07:00
Beka Westberg
6d87b85e6c fix: not being able to specifying variable names in toolbox (#5408)
* fix: not being able to specifying variable names in toolbox

* fix: id -> ID
2021-09-20 13:08:35 -07:00
Beka Westberg
8faa360b74 feat: upgrade fields to use new JSO hooks (#5077)
* Upgrade field angle to use new serialization

* Upgrade field checkbox to use new serialization

* Upgrade field colour to use new serialization

* Upgrade field dropdown to use new serialization

* Upgrade serializable label field to use new serialization

* Upgrade field multiline input to use new serialization

* Upgrade field number to use new serialization

* Upgrade field text input to use new serialization

* Upgrade variable field to use new serialization

* Fix type casts

* Feedback from PR

* Switch to use getValue()
2021-09-20 13:08:35 -07:00
alschmiedt
5b1586ee1b test: update mocha tests to use goog_module (#5440)
* Use goog.module in mocha tests

* Fix compiler warnings

* Make test helpers a module

* Name test modules Blockly.test.*

This is to be more consistent with how non-test modules are named.

Also remove top-level goog.require of TestHelpers (now
Blockly.test.helpers) since requiring a side-effect-less module does
nothing.

* Convert block_test.js and comment_test.js to goog.module syntax

* Address PR comments

* Goog modulify tests

* Goog modulify toolbox helpers

* Fixes imports and moves common tests from workspace_test.js to a helper file.

* Update test deps after rebase

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-09-16 13:00:38 -07:00
Aaron Dodson
c86c8f8e92 Migrate core/variables.js to goog.module syntax (#5321)
* Migrate core/variables.js to ES6 const/let

* Migrate core/variables.js to goog.module

* Migrate core/variables.js to named requires

* clang-format core/variables.js

* Add JSDoc and make testdeps function test-only

* Fix return type for getTestDeps

* Migrate to new style of exposing methods for mocking in core/variables.js
2021-08-12 09:55:38 -07:00
Monica Kozbial
7eabb8e8a3 Update inccorect jsdoc in mocha tests (#4707) 2021-03-19 16:33:41 -07:00
Monica Kozbial
8361268c63 Refactor field_variable_tests to use dev-tools (#4417)
* Refactor field_variable_tests to use dev-tools
2020-11-06 11:35:00 -08:00
Monica Kozbial
896c630a89 Shared global cleanup (#4217)
* Refactor block type cleanup into shared cleanup.

* Use shared cleanup for block type cleanup.

* Remove overwriting of core Blockly block in test.

* Rename cleanup arrays for clarity

* Add blocks to cleanup array when defined in shared helpers

* Refactor logic for adding to shared cleanup.

* Add helper for defining block and adding block type to cleanup.

* Fix jsdocs

* Simplifying helpers for adding to cleanup.

* Add missing semicolons

* Update jsdoc for sharedTestSetup

* Use stub to wrap cleanup with defineBlocksWithJsonArray

* Remove unused helper from lint ignore
2020-09-09 15:51:34 -07:00
Monica Kozbial
b87d4497ae Update test asserts on stubs to use sinon asserts (#4205)
* Update asserts for stubs to use sinon asserts.

* Manual update of unclear stub assert.
2020-08-20 19:01:46 -07:00
Monica Kozbial
2e92123314 Adding async cleanup to tests (#4103)
* Adding setup and teardown to more mocha tests.

* Update workspace dispose cleanup calls.
2020-08-05 16:00:00 -07:00
Monica Kozbial
3868db3221 Refactor shared (#4066)
* Refactoring event helpers.

* Fix concurrent test failure.
2020-07-24 14:49:39 -07:00
alschmiedt
a23d2fb9d0 Remove assertArrayEquals (#3951) 2020-06-10 10:25:59 -07:00
Monica Kozbial
0adf7efd5f Converting jsunit asserts to chai. (#3831)
* Converting jsunit asserts to chai.

* Move jsunit functions to test_utilities.

* Adding eslint exception for helper method.
2020-04-17 16:08:46 -07:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Beka Westberg
593383e18a Changed variable field to use configuration (#3065)
* Changed variable field to use new configuration.
2019-09-23 11:14:03 -07:00
Beka Westberg
a5bc29357f Added unit tests. 2019-07-19 08:57:34 -07:00
Beka Westberg
b34ca2f93b Fixed review comments. 2019-06-25 15:08:01 -07:00
Beka Westberg
427291c05d Added skipping bad variable test. 2019-06-25 15:08:01 -07:00
Beka Westberg
e6caa50131 Added more setValue test coverage. 2019-05-25 10:20:20 -07:00
Beka Westberg
f16c9c0beb Refactored field validation. 2019-05-24 14:23:42 -07:00
Beka Westberg
acd96aa2c5 Added Field Value Tests (#2459)
* Added field value tests.

* Fixed field image src param.

* Fixed falsy values with label fields.

* Fixed falsy values with text input fields.

* Fixed some angle field tests.

* Fixed other text input when editing tests.

* Fixed colour tests.

* Cleaned up some number and variable field tests.

* Added angle field > 360 degrees tests.

* Fixed variable validator tests.

* Split setValue tests into sub-suites.

* Fixed angle >360 tests

* Changed var declarations to property declarations.
2019-05-17 15:19:14 -07:00
Rachel Fenichel
089c30baa1 Add eslintrc to mocha directory 2019-01-09 13:31:07 -08:00
Rachel Fenichel
298b93c025 Fix eslint errors with in-file comments 2019-01-08 11:54:57 -08:00
Rachel Fenichel
1c413f0442 More testing with mocha 2019-01-08 11:31:35 -08:00