Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

caleballdrin
Copy link
Contributor

Description

https://jira.cru.org/secure/RapidBoard.jspa?rapidView=3&view=detail&selectedIssue=MPDX-8167&sprint=1259#

  • Replace and redirect URL's with invalid accountListIds

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@caleballdrin caleballdrin self-assigned this Sep 20, 2024
@caleballdrin caleballdrin added the Preview Environment Add this label to create an Amplify Preview label Sep 20, 2024
@caleballdrin caleballdrin changed the title Mpdx 8167 Account list redirect MPDX-8167 Account List redirect Sep 20, 2024
Copy link

Copy link

Bundle sizes [mpdx-react]

Compared against a8a2f6e

No significant changes found

const nonAccountListError =
error instanceof ApolloError &&
error.graphQLErrors.every(
(error) => !isAccountListNotFoundError(error),
Copy link
Contributor Author

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.

Comment on lines +131 to +134
req: { url: '/accountLists/[accountListId]/contacts' },
query: {
accountListId: 'account-list-1',
},
Copy link
Contributor

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'),
Copy link
Contributor

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.

@canac
Copy link
Contributor

canac commented Sep 20, 2024

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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants