-
Notifications
You must be signed in to change notification settings - Fork 205
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
@daml/react: Add an initial test suite #4612
Conversation
34424e6
to
914c917
Compare
@aherrmann This is the test which success with
|
366462b
to
577b1fc
Compare
The test failure might be caused by the same issue as described in bazel-contrib/rules_nodejs#1383. I'll see if I can apply the same solution as described here to the jest tests. While investigating the issue I found that there's an eslint plugin for react hooks. That might address some of this issue. See b4f80e6. |
@aherrmann What you're doing in b4f80e6 won't work since it triggers a call to the JSON API on each rerendering rather than only when the query/key has actually changed. The problem is that a new closure for the factory for the query/key is allocated on each rerendering. Thus, the factories must not appear in the dependencies. Unfortunately, the ESLint rules for hooks won't help us with this special setup hence. |
This only tests that the `useQuery` hook does the right thing once the call to `Ledger.query` has resolved. CHANGELOG_BEGIN CHANGELOG_END
CHANGELOG_BEGIN CHANGELOG_END
d715a35
to
eb3d419
Compare
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.
Cool!
This only tests that the
useQuery
hook does the right thing once thecall to
Ledger.query
has resolved.CHANGELOG_BEGIN
CHANGELOG_END
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.
This change is