Commit Graph

246 Commits

Author SHA1 Message Date
Rachel Fenichel f52b75a198 Merge pull request #1778 from AnmAtAnm/shadow-pop
Rewrote LOGIC_COMPARE_ONCHANGE_MIXIN to fix #1408.
2018-04-13 17:04:12 -07:00
Andrew n marshall c0e220214c Rewrote LOGIC_COMPARE_ONCHANGE_MIXIN to fix #1408.
* Create prevBlock_ upon first call to onchange.
 * Revert state upon an incompatible combination, bumping the new incompatible
   block, instead of the old block. Thus, the shadow is never the bumped block.

Bug:
 * The undo stack get caught in a loop, and will never undo back to a state
   equivalent to the previous action.
2018-04-12 17:27:20 -07:00
Rachel Fenichel 23666664fa Fix context menus on blocks with variables 2018-04-12 16:56:07 -07:00
Andrew n marshall 5c541c6f99 Setting the value of math_numnber toolbox blocks to 123. (#1773)
Using 123 as a better indicator to the user this block can represent any number,
and the user should replace this value with their own desired number.
2018-04-12 14:46:37 -07:00
Rachel Fenichel 42cb962cef Apply review feedback. 2018-04-11 15:26:05 -07:00
Rachel Fenichel 9a62e6aa70 Merge pull request #1767 from rachel-fenichel/metrics_test
Simple tests for getContentDimensions
2018-04-11 13:41:12 -07:00
Rachel Fenichel e11ec48ed3 Break tests out into individual cases 2018-04-11 13:35:54 -07:00
Andrew n marshall ecc41372d7 Fixing issue 1760: nulls in JSON array for block definitions. (#1768)
JSON array with null or undefined value will now skip the offending item, and proceed to load following items. Added tests for null and undefined array elements.

* Testing handling null and undefined id in block definition.
* Adding test utility function to capture console warnings.
* Test assumption that creating a simple block will not cause a warning. This is assumed when later checking warning counts.
2018-04-11 10:22:30 -07:00
Rachel Fenichel 9f07d04709 Simple tests for getContentDimensions 2018-04-09 11:28:18 -07:00
picklesrus 063b5d880c Add a test block with a dropdown containing both text and images (#1748) 2018-03-29 13:15:20 -07:00
Andrew n marshall abb0047e41 Adding warnings to not include <varaibles> (#1645)
...in generator test workspace files.
2018-02-21 13:56:26 -08:00
Andrew n marshall 2358fe6fd5 Adding test cases for Unicode in blocks. (#1646)
Adds test blocks to demonstrate capabilities. Stopped short of adding BiDi override characters.
I added to the toolbox category "Images". It isn't really images, but it didn't seem worth making a separate category at this stage.
2018-02-21 13:53:44 -08:00
Andrew n marshall 8fcdbf0eae Adding new playground test category "Drag" (#1643)
Edge cases to test involving dragging blocks from the toolbox.
2018-02-20 14:12:44 -08:00
Andrew n marshall 4092a644d5 Adding a iframe wrapper around the playground. (#1634) 2018-02-16 16:48:11 -08:00
Andrew n marshall d9a7f84b98 Adding test blocks into the playground (#1629)
The new toolbox option includes a number of test blocks
largely pulled from the android project, testing various
configurations and edge cases.
2018-02-16 11:14:40 -08:00
Mark Gibson 54f0e06e21 Customising field types using a register of fields #1584 (#1594)
Implement #1584 - Fields now registered by their JSON type name, allowing new custom fields and overriding of the standard fields. Replaces the manual switch statement for loading fields from JSON block definitions.
2018-02-14 10:14:59 -08:00
Rachel Fenichel 2bd606c5e7 Fix comments 2018-02-13 10:41:57 -08:00
Rachel Fenichel 3a8fc92143 Indentation 2018-02-12 17:14:26 -08:00
Rachel Fenichel 744e70e4d2 Split playground toolbox XML into typed and untyped examples. 2018-02-12 17:12:52 -08:00
Mark Gibson 28d3d68b62 Fix fromJson_ to fromJson in tests 2018-02-07 18:30:22 +00:00
Mark Gibson d40ef474ae See issue #1486 - adds fromJson_ fn to every Blockly.Field, removing Block.newField*FromJson_ helpers 2018-02-07 12:22:26 +00:00
Rachel Fenichel 6d96e4003b Merge pull request #1576 from rachel-fenichel/bugfix/1574
Add generators for dynamic variable blocks.
2018-01-29 16:20:28 -08:00
Rachel Fenichel 4a059b23f8 Add tests 2018-01-29 16:04:47 -08:00
Rachel Fenichel 4c130aab83 Rename createVarBlock to createMockVarBlock, and pass in the workspace as a parameter 2018-01-29 15:15:32 -08:00
Rachel Fenichel bce24fef6b Add generators for dynamic variable blocks. 2018-01-26 17:10:45 -08:00
Rachel Fenichel 7314bdfb3a Fix #1499 and add some validation 2018-01-17 16:54:12 -08:00
Rachel Fenichel 5d6d7519cd Remove some TODOs; add a variable-referencing block to the simple playground flyout 2018-01-08 14:14:26 -08:00
Rachel Fenichel 0a0b6f3848 Add error; python and php tests pass. 2017-12-20 16:28:14 -08:00
Rachel Fenichel fced496d28 Lua generator tests pass with new variables 2017-12-20 15:23:05 -08:00
Rachel Fenichel 3d0567fe46 JS and Dart generator tests pass 2017-12-20 15:14:37 -08:00
Rachel Fenichel 4cd0b36944 Fix event ordering for variables created from XML implicitly 2017-12-19 14:25:52 -08:00
Rachel Fenichel 6218750207 Fix events for variable fields on new blocks; fix tests 2017-12-19 11:28:23 -08:00
Rachel Fenichel df1d5ba525 fix tests 2017-12-15 14:07:17 -08:00
Rachel Fenichel be4054b593 Tests 2017-12-13 11:50:08 -08:00
Rachel Fenichel 399f1a5c11 Tests 2017-12-13 11:50:08 -08:00
Rachel Fenichel 24672bcbb2 Remove ws.updateVariableStore and tests, and ws.getVariableUses 2017-12-13 11:50:08 -08:00
Rachel Fenichel 61db23c78a Get rid of workspace.deleteVariable 2017-12-13 11:50:08 -08:00
Rachel Fenichel 523a10413b All tests pass 2017-12-13 11:50:07 -08:00
Rachel Fenichel 19939dc16a All but XML tests now pass 2017-12-13 11:50:07 -08:00
Rachel Fenichel 3728cfed45 Update tests in workspace_test. Get rid of renameVariable 2017-12-13 11:50:07 -08:00
Rachel Fenichel c55b6afc6f Fix tests in field_variable_test.js 2017-12-13 11:50:07 -08:00
Rachel Fenichel 779be46a92 Allow variables of different types to share the same name. 2017-12-13 11:50:07 -08:00
Neil Fraser bc1a5baa48 Fixes to Generator tests (#1510)
* Remove unneeded report variable from generator tests.
* Fix missing message parameter in unittest_fail.  This was a compile error in Dart.
* Fix indentation in PHP.
* Equality helper function not needed in PHP.
2017-12-12 17:38:38 -08:00
Rachel Fenichel 0cb5dfc437 Merge pull request #1492 from Kenny2github/patch-1
Remove "fake some drags!"
2017-12-11 17:12:11 -08:00
Tianwei Du 492462e1d4 Develop (#1481)
* variables_dynamic

* make test , and i18n

* Issue #1470

* Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_MUTATION
to make sure setCheck before event trigger

* Update built files from develop.

* fix copyright ,quotes , comments ,  and optimize some flow.

* quotes,change UI , change category custom name

* single setter , remove mutator , colour typo , typed variables create button message

* undo the indent edits.
2017-12-08 08:53:24 -08:00
Ken c53dec9786 Remove "fake some drags!"
Removed the button, the "fakeDrag" and "fakeManyDrags" and "fakeDragWrapper", and the "fakeDragStack" list.
2017-12-02 11:47:46 +08:00
Andrew n marshall aa78a8b566 Better error reporting when the test XML fails to load. (#1443) 2017-11-14 13:36:38 -08:00
Rachel Fenichel 66586bf622 Add a test for case-sensitivity in the variable names, ids, etc. in the flyout 2017-11-03 16:03:32 -07:00
Rachel Fenichel 30716fbd78 switch to variabletype everywhere 2017-11-03 16:03:32 -07:00
Evan W. Patton 67e192e208 Fix logic bugs related to e1e9427 (#1398)
This commit adds a fallback when attempting to merge events that
collide on a hash but do not actually merge. Previously, the latter
event would be dropped.

This also fixes a minor UX problem where moving the isNull check into
the merging loop resulted in extra events in the undo queue that
served no purpose and required multiple undo operations without visual
feedback.

Fixes #1373
2017-10-27 16:04:17 -07:00