-
Notifications
You must be signed in to change notification settings - Fork 1
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
MPDX-7946 use contact mutation when adding email #973
MPDX-7946 use contact mutation when adding email #973
Conversation
It looks like you've done the same thing here: #958. You need to merge main into this branch |
71cf81d
to
633d1fa
Compare
Bundle sizes [mpdx-react]Compared against b77c3de No significant changes found |
b8bf6fd
to
db1a35a
Compare
ada4713
to
a62a556
Compare
626f5f6
to
17b3df4
Compare
17b3df4
to
885fd4c
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.
Great work, there were some changes I thought needed to happen before we role this PR liv, which I've commented below. Feel free to disagree with my thoughts.
cache: InMemoryCache; | ||
} | ||
|
||
const addEmailAddress = async ({ |
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.
We shouldn.t have a component in a test like this. Ifn we want to test addEmailAddress we should import it rather than recreate it.
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 isn't a component, it is a helper function to reduce code duplication.
userEvent.click(addButton); | ||
}; | ||
|
||
it('should add an email address to the first person', async () => { |
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.
We should make the test like how the user would interact with the component. Such as types in new email and clicks "add", this should fire a GraphQL Mutation request we can test.
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.
That is what we are doing here, though I never found good ways to test what data got sent in the mutation, so I went with what got sent to the cache instead.
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 have updated the code to add some more tests and clean up the PR.
9e12d3f
to
5d87678
Compare
Description
MPDX 7946
Related to MPDX 7941
Will add a contact mutation when users click the + button after entering a valid email
Checklist: