-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: Migrate "lib/accept" to single test runner #4503
Conversation
confirmButtonText: React.PropTypes.string, | ||
cancelButtonText: React.PropTypes.string, | ||
translate: PropTypes.func, | ||
message: PropTypes.node, |
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 didn't know there is node type :P Great to know 👍
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 didn't know there is node type :P Great to know 👍
As the original author of this component, neither did I at the time apparently 😆
Really great improvement. Tests works as expected and code looks nice. I would mark it as |
389d615
to
5223896
Compare
@gziolo : Thanks for the feedback. I rebased and (force-)pushed some revisions to how I had tackled the i18n problem. Rather than auto-initializing in the case that a translate attempt is made before initialization, I created a separate helper in Let me know whether you think this is a better approach. |
@@ -97,6 +97,7 @@ node_modules: package.json | node-version | |||
test: build | |||
@npm run test-client | |||
@npm run test-server | |||
@npm run test-tests |
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.
yeah, we missed that one 👍
It looks great, I should run it in the browser. Give me couple of minutes :D |
It also works as advertised
I think this is the best possible approach for all existing tests 👍 |
5223896
to
8893710
Compare
Related: #3942
This pull request seeks to migrate tests for
lib/accept
to the single test runner. It also includes revisions to thei18n
mixin to better accommodate test contexts.Implementation notes:
translate
stubbing has been swapped with the recently-addedlocalize
higher-order component. This alone was not sufficient to replace the existingtranslate
stub, as thei18n
module errors when trying to calltranslate
before Jed has been initialized. To accommodate this, if a translate attempt is made before Jed is initialized, an empty Jed instance is created on-demand (23aed07). This should not affect existing browser usage asi18n
is initialized during boot, but will simplify testing (avoiding need for explicit i18n initialization).Testing instructions:
Verify both that Mocha tests pass, and that no regressions occur in
accept
usage. An example ofaccept
is the prompt which occurs when trying to delete media from your post editor media library./cc @rralian , @gziolo