-
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-8167 Account List redirect #1084
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Caleb Cox <canac@users.noreply.github.com>
Preview branch generated at https://MPDX-8167-accountList-redirect.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against a8a2f6e No significant changes found |
const nonAccountListError = | ||
error instanceof ApolloError && | ||
error.graphQLErrors.every( | ||
(error) => !isAccountListNotFoundError(error), |
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.
@canac Codecov wants me to test lines 128 and 129. Do you have any ideas on how to do that?
It also wants coverage for many lines in client.ts. I'm not sure what to do there.
req: { url: '/accountLists/[accountListId]/contacts' }, | ||
query: { | ||
accountListId: 'account-list-1', | ||
}, |
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.
You could make a makeContext
helper function that takes a URL and returns this context object. Then you could use makeContext
in each test to reduce some of the duplication.
|
||
it('replaces the default accountListId in the url', () => { | ||
expect( | ||
replaceUrlAccountList('/accountList/invalid-account-list/', '12345'), |
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.
Is this supposed to be /accountLists/...
(pluralized)? If it's supposed to be an invalid pathname, let's use a url like /invalid-url
and move it to returns to default url if defaultAccountListId is invalid
.
Either way, it's probably good to have a test for /accountLists/invalid-account-list/
too.
I might be biased, but I think this is pretty good 😄 @dr-bizz Caleb and I pair-programmed it, so you may want to look at this on Monday. This PR probably won't have full test-coverage because we added lines to files that are hard to test, but I think you tested the lines that are easily testable. 👍 |
Description
https://jira.cru.org/secure/RapidBoard.jspa?rapidView=3&view=detail&selectedIssue=MPDX-8167&sprint=1259#
Checklist: