Commit Graph

284 Commits

Author SHA1 Message Date
Rachel Fenichel
adb1921e21 Add suite name to generator tests 2018-10-18 17:47:58 -07:00
Rachel Fenichel
5fcadc0a05 Use checkboxes instead of a dropdown for generator test selection 2018-10-18 17:11:20 -07:00
Neil Fraser
8d70598b6b Recompile due to changed dependencies. 2018-10-16 11:34:10 -07:00
Nadya Febiana Djojosantoso
e1217252ff Update math_atan2 unit test 2018-10-15 21:01:53 -07:00
Nadya Febiana Djojosantoso
da48f3c66f Add math_atan2 unit test 2018-10-11 15:14:08 -07:00
Nadya Febiana Djojosantoso
d822efa322 Add math_atan2 block to demos and playgrounds 2018-10-11 14:56:13 -07:00
Neil Fraser
346b24aa74 Playground upgrades (#2063)
Adds two new blocks to the playground's test blocks.
Fixes dropdown which previously could not be set to 'Test Blocks' due to missing condition.
Simplifies detection of file:// url.
2018-09-25 13:59:26 -07:00
ImgBotApp
583dfea6dd [ImgBot] optimizes images
*Total -- 61.18kb -> 44.41kb (27.42%)

/demos/headless/icon.png -- 4.26kb -> 1.80kb (57.72%)
/demos/interpreter/icon.png -- 3.13kb -> 1.71kb (45.13%)
/tests/media/g.png -- 1.14kb -> 0.66kb (42.17%)
/tests/media/50px.png -- 1.55kb -> 0.93kb (40.31%)
/demos/graph/icon.png -- 1.72kb -> 1.03kb (40.01%)
/tests/media/30px.png -- 1.10kb -> 0.67kb (39.4%)
/media/sprites.png -- 4.05kb -> 2.53kb (37.41%)
/tests/media/m.png -- 1.02kb -> 0.65kb (36.49%)
/tests/media/c.png -- 0.84kb -> 0.59kb (29.21%)
/tests/media/b.png -- 0.75kb -> 0.55kb (26.79%)
/demos/accessible/icon.png -- 1.38kb -> 1.01kb (26.69%)
/demos/generator/icon.png -- 3.52kb -> 2.61kb (25.64%)
/tests/media/a.png -- 0.76kb -> 0.57kb (25.45%)
/demos/fixed/icon.png -- 2.06kb -> 1.57kb (24.08%)
/tests/media/d.png -- 0.72kb -> 0.55kb (23.58%)
/demos/resizable/icon.png -- 3.18kb -> 2.47kb (22.27%)
/demos/toolbox/icon.png -- 2.76kb -> 2.16kb (21.83%)
/demos/rtl/icon.png -- 3.07kb -> 2.41kb (21.46%)
/tests/media/200px.png -- 2.11kb -> 1.67kb (21.06%)
/appengine/apple-touch-icon.png -- 3.93kb -> 3.15kb (19.78%)
/demos/code/icon.png -- 3.95kb -> 3.19kb (19.44%)
/demos/blockfactory_old/icon.png -- 4.34kb -> 3.55kb (18.17%)
/demos/maxBlocks/icon.png -- 1.96kb -> 1.61kb (17.87%)
/tests/media/k.png -- 0.60kb -> 0.50kb (16.18%)
/demos/plane/icon.png -- 3.32kb -> 2.80kb (15.63%)
/demos/storage/icon.png -- 3.19kb -> 2.71kb (14.99%)
/media/quote0.png -- 0.78kb -> 0.75kb (3.14%)
2018-09-23 13:31:54 -07:00
RoboErikG
9eacd7d3b9 Disable/enable function calls along with their definitions (#2019)
Fixes #1344

Extends the event listener on procedure caller blocks to also check
for their definition being enabled/disabled and update their own
state in response.
2018-08-23 11:18:29 -07:00
Andrew n marshall
46ee2d90fb Moving media/test_* files (PR #2004)
...to tests/media/.
2018-08-15 14:42:53 -07:00
RoboErikG
22fc0f8af9 Add test for replacing a rendered shadow block (#1981)
PR #1970 created a bug that only occurred when replacing a rendered
shadow block. Add a test for this case to prevent breaking it again.
2018-08-14 09:52:02 -07:00
Rachel Fenichel
341865c80c Merge pull request #1995 from rachel-fenichel/feature/unplug_horizontal
Heal rows when unplugging, and add tests
2018-08-06 11:28:12 -07:00
Rachel Fenichel
b89487e332 Ignore whether parent has multiple inputs 2018-08-06 11:18:00 -07:00
Neil Fraser
c6afb08c4b Add unit tests and code cleanup to utils (#1993)
* Add unit tests for new util functions
* Utils functions shouldn’t be package, not private.
* Use existing utility function for insertAfter
2018-08-03 14:31:50 -07:00
Rachel Fenichel
b65491e656 Heal rows when unplugging, and add tests 2018-08-03 13:54:29 -07:00
Rachel Fenichel
b52267bee9 Tests for block.unplug 2018-08-02 17:35:10 -07:00
RoboErikG
61803167d8 Add test for deleting a rendered block with a comment (#1984)
Disabled for now as it fails due to #1960.
2018-07-23 10:56:37 -07:00
RoboErikG
c815608fdf Fix failing svg canvas test (#1977)
Partial fix for #1976. This fixes the broken test by initializing the
svg for blocks when they're created.
2018-07-17 09:35:53 -07:00
Rachel Fenichel
999f8a114d Remove variable IDs from colour test XML 2018-06-29 10:47:03 -07:00
Rachel Fenichel
28eb831754 Better error messages in colour generator tests 2018-06-27 14:41:53 -07:00
Rachel Fenichel
83855248a6 Correctly adjust indices in colour tests 2018-06-27 14:32:40 -07:00
Andrew n marshall
eafc3cd099 Adding appropriate test values to number field test blocks (#1943) 2018-06-26 18:19:01 -07:00
Rachel Fenichel
3c6a29c705 Move a test function into utils 2018-06-07 16:58:58 -07:00
Rachel Fenichel
55dca1eed5 Update chromedriver version
See https://github.com/LLK/scratch-blocks/pull/1568
2018-06-07 11:25:42 -07:00
Rachel Fenichel
7b29ea9bf3 Add some workspace comment tests 2018-06-06 17:12:23 -07:00
Rachel Fenichel
1f9c0d0e95 Add a comment with some context on this test. 2018-05-25 10:38:55 -07:00
Rachel Fenichel
e6a875bb02 Make event filtering stricter for events 2018-05-24 17:12:00 -07:00
Andrew n marshall
9b8704f4bc Adding travis_fold logging around each test (#1879)
Replace individual .travis.yml commands and test_runner.js with tests/run_all_tests.sh, which manages the travis_fold statements and accumulating the output of all the test phases.

This script is now in charge of test_setup.sh (previously handled by npm pretest script). It also adds green/red color coding to each test section, based on success and failure.
2018-05-22 17:23:01 -07:00
Andrew n marshall
a3dfd0553d tests/compile/compile.sh improvements (#1874)
tests/compile/compile.sh improvements
 * Allow running from either Blockly root or local dir.
 * Allow the use of npm google-closure-library.
 * Log compiler/library versions
 * Log full *compiler*.jar filename. Limit to one match.
 * Add npm instructions for both compiler and library.
 * Minor stylistic polish.
2018-05-17 12:10:35 -07:00
Andrew n marshall
402f2bc38c Adding all blocks to the compilation. (#1877)
Correct the procedures require listed in the comment.
2018-05-17 11:51:54 -07:00
Andrew n marshall
f2b6c9a948 Work in progress (Needed a Travis run) (#1869)
Fix advanced compilation on Travis
2018-05-16 14:16:02 -07:00
Rachel Fenichel
d6444659ad Don't keep the list of test names separate from the dropdown 2018-05-14 17:35:30 -07:00
Rachel Fenichel
ed410a84b2 Button to load all XML files for testing 2018-05-14 17:12:37 -07:00
Rachel Fenichel
02aada1e3d Make ui events work when block is null; test 2018-05-03 17:36:08 -07:00
Andrew n marshall
0ffd5dda18 Changing root script for tests under Node. (#1837)
* Changing root script for tests under Node.

Was: tests/jsunit/test_runner.js
Now: tests/test_runner.js

The webdriver & jsunit calls formerly in tests/jsunit/test_runner.js
are now in function runJsUnitTestsInBrowser, in
run_jsunit_tests_in_browser.js, called from tests/test_runner.js.

This makes room for additional tests under Node, such as headless and generator tests.
2018-05-02 12:19:49 -07:00
Andrew n marshall
9ce9c6f7d9 Using %{BKY_} notation for toolbox category colours. (#1826) 2018-04-30 13:08:02 -07:00
Rachel Fenichel
ee6f2ea097 Comments v3 (#1817)
* Add skeleton for workspace comments

* XML parsing and encoding of workspace comments.

* Minor fix: piping the height and width from xml to newWorkspaceComment

* Move height and width into workspace_comment_svg

* rename newWorkspaceComment to newComment

* minor refactoring. PR changes

* Functions for managing the comment's lifecycle

* Add initial tests

* Add another test

* Add basic rendering of a comment.

* Cleanup remaining highlighting steps from render

* Fix lint

* Fix aslant

* Add basic comment translate

* Simplify render code into one setPath method

* Move steps to setPath_

* Remove svg elements when disposing of a comment; some code cleanup

* Add a workspace comment on context menu click and position it where the initial context menu was clicked.

* Minor rendering changes, fixes RTL. Fix positioning of new (context menu) comments while workspace is scaled.

* PR feedback

* Gesture code for dragging comments

* Add comment (block drag) surface methods

* minor comment fix

* Comment fixes

* Add comment dragger

* Making rendered private

* Require CommentDragger

* Make basic comment dragging work

* Increase the border around the comment to make a bigger drag handle

* Remove typo

* Allow comments to be selected. Highlight selected comment. Only edit comment on click. Updated comment rendering.

* minor refactor: remove commented out code

* PR comments

* lint and rebuild

* Fix renamed function call

* Fix workspace getMetrics by storing comment size as a number, not a string

* Enable comment deletion when dragging over the toolbox or trash can

* Give issue references to some todos

* Create a helper function for workspace comment creation

* Integrate sam's workspace comments, using the bubble dragger

* Remove comment_dragger references

* Remove comment dragger.js

* Remove pointer handling

* Fix lint

* Move comment XML functions into the comment files.

* Fix tests

* Fix type annotations

* Fix comments on comments

* Fix compiler errors related to visibility.

* Fix merge issues and add an issue number to a TODO

* Add a new message for default text on workspace comments, and rebuild

* Add support for a context menu on workspace comment showing delete and duplication options.
Add copy and paste support.

* PR comment feedback

* Show a delete icon on the comment when selected. Delete icon deletes the comment. Comment can be deleted if dragged onto the toolbox or the trash icon. A normal bubble cannot be deleted that way.

* use isDeletable instead

* Support drag of the comment during editing mode using the top handle.

* Add skeletons for all workspace comment events

* Rebuild with new comments

* Get rid of confused TODO

* JSDoc on a function

* Fix broken tests

* More PR feedback

* Fix lint

* Delete comment on mouse out, highlight on mouse down.

* Fix lint.

* Show delete hand cursor when dragging a comment to delete over the toolbox

* Focus textarea on select

* Add delete events

* Remove workspace comment create event, and add TODO placeholder

* Provide default values if comment height and width are missing in XML

* Set comment handle fill to none by default

* Rebuild

* Comment de/serialization should include location.

* Add comment move events, with undo and redo

* Add comment change events

* Move files up to core

* Add package/private annotations wherever possible

* Move the workspace comment events up to core and into a single file

* Mark things package or private where possible

* Get rid of unnecessary changes to messge files

* Fix lint

* Fix some review feedback

* Make changes to the comment db happen in addTopComment and removeTopComment

* Add css classes for toggling comment focus

* Clean up css for comment focus

* Rebuild
2018-04-27 15:18:59 -07:00
Rachel Fenichel
d8202f8cae Create base classes for block and variable events, instead of stuffing everything into Abstract 2018-04-19 16:15:00 -07:00
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