-
Notifications
You must be signed in to change notification settings - Fork 2.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
Hotfixes #9328
Hotfixes #9328
Conversation
78c136a
to
f44ab99
Compare
expect(errorMock).toHaveBeenCalledTimes(1); | ||
expect(errorMock.mock.calls[0][0]).toMatch("Missing field"); | ||
errorMock.mockRestore(); |
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 think we should not do the below assertions
expect(errorMock).toHaveBeenCalledTimes(1);
expect(errorMock.mock.calls[0][0]).toMatch("Missing field");
Those elements are part of validation that is not tested here.
Otherwise if someday we will going to change the validation message from
Missing field
to The field "name" is missing
we will need to update much more 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.
This is mostly a sanity check to make sure another error hasn’t snuck into the test. The tests would definitely fail if we changed the error message but I’m okay with it because that would be a quick fix.
4e72cbb
to
8e0e7a2
Compare
8e0e7a2
to
0733117
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.
LGTM with a few small questions. Thanks @brainkim!
0733117
to
d9f096e
Compare
thanks for the stale variables fix, this was driving me crazy and I was thinking it was me. |
Review by commit.
Fixes #9101, #9129, #9142.
As a way to simplify
useLazyQuery()
, we are now using theskip: true
/refetch pattern described in #9101 to defineuseLazyQuery()
, which should give ususeMutation()
like error behavior.useEffect()
just should not be trusted to do anything at all.