-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Utilize getIcon instead of getCommentIcon in tests #7200
fix: Utilize getIcon instead of getCommentIcon in tests #7200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, this looks great :D Just one fixup and then this should be good to go!
@@ -10,6 +10,7 @@ import { | |||
sharedTestSetup, | |||
sharedTestTeardown, | |||
} from './test_helpers/setup_teardown.js'; | |||
import {CommentIcon} from '../../core/icons/comment_icon.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should have been from '../../build/src/core/icons/comment_icon.js'
(here and below).
We are now seeing build warnings that I believe are due to this; I'm actually not certain how this test is running successfully as I would not expect the import as written to work at all:
Could not find "../../core/icons/comment_icon.js".Assuming it (and its transitive dependencies) are non-Closure managed. /Users/cpcallen/src/blockly/tests/mocha/comment_deserialization_test.js
Could not find "../../core/icons/comment_icon.js".Assuming it (and its transitive dependencies) are non-Closure managed. /Users/cpcallen/src/blockly/tests/mocha/contextmenu_items_test.js
...
Tweak the test files touched by PR google#7200 to be consistent with existing usage of Blockly.icons.CommentIcon instead of importing this separately.
* fix(tests): Fix invalid import paths in mocha tests This resolves the warnings generated during buildDeps by closure-make-deps. This commit does not attempt to address #7224 or otherwise rationalise the imports and usage thereof. * fix(tests): Fix failing context menu item test Test appears to have been wrong: Block.prototype.getIcon is typed as getIcon<T extends IIcon>(/* ... */): T | undefined and documented as "@returns The icon with the given type if it exists on the block, undefined otherwise." * refactor(tests): Clean up inconsistent usage of CommentIcon Tweak the test files touched by PR #7200 to be consistent with existing usage of Blockly.icons.CommentIcon instead of importing this separately.
The basics
npm run format
andnpm run lint
The details
Resolves
Fixes #7164
Proposed Changes
utilize
getIcon()
in preparation for v11Behavior Before Change
Behavior After Change
Reason for Changes
Test Coverage
npm run test:mocha:interactive
-> check consoleDocumentation
Removed deprecation function, docstring, and dependencies from
block_svg.ts
Additional Information
N/A