Refactor shared#4066
Merged
moniika merged 5 commits intoJul 24, 2020
Merged
Conversation
moniika
commented
Jul 23, 2020
| // TODO(#4064): Remove clearing of event clear here in favor of adding cleanup | ||
| // to other tests that cause events to be added to the queue even after they | ||
| // end. | ||
| Blockly.Events.FIRE_QUEUE_.length = 0; |
Contributor
Author
There was a problem hiding this comment.
This fix seems to work.
However, I thought I had tested with this change at some point and it didn't work, but it works now.
I'm a little worried that this fixes most failures, but there's still "sometimes" failures, which is why I want to address this better in a follow up as part of #4064.
Contributor
Author
|
Upon investigation, there are other instances where Blockly.Events.fire is stubbed/spied such as in |
rachel-fenichel
approved these changes
Jul 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Part of #4065
Proposed Changes
Blockly.utils.genUidinto shared_helpers.js and updated usages.assertEventEquals)comment_test.jsevent_test.jsandtrashcan_test.jsto use new event test helpersReason for Changes
Test Coverage
Ran mocha tests.
Tested on:
Documentation
Additional Information
Test methods were refactored as helpers were developed to better fit the needs of multiple tests, causing multiple files to be touched.
#4062 fixes eslint errors on the PR.
Initially after this refactor the test failed when they were running concurrently, revealing that some tests cause events to be fired on a timeout which causes failures in other event tests. A bug was filed #4064 to further investigate and resolve this issue. As a temporary fix, the event queue is cleared when a stub is created for
Blockly.Events.firebut it is not the ideal fix.