Skip to content

Conversation

@wdoconnell
Copy link
Contributor

@wdoconnell wdoconnell commented Aug 16, 2022

Closes #4053

Adds e2e tests for the 'change account' and 'change org' dropdowns in the multi-org phase 1 global header. The remaining e2e tests for multi-org were completed in #5386 and #5381.

  1. Don't render the header if the server fails to provide the user's account/org data.

  2. Account Dropdown

    • Navigate to the Settings page
    • Navigate to the Billing page
    • Change the current account
  3. Organization Dropdown

    • Navigate to the Settings page
    • Navigate to the Members page
    • Navigate to the Usage page
    • Change the current organization

The hurdle in testing global header is that the URLs targeted by the dropdown include IDPE-generated org IDs. In prod, the IDPE org id and the quartz org ID are the same. In remocal and CI, they are not, because quartz-mock serves static org ids.

This PR makes those links visitable during e2e testing by making one API call to retrieve the IDPE org ID, then intercepting calls to the quartz API and replacing the org id served by quartz mock with the IDPE org id.

Screen.Recording.2022-08-16.at.5.26.44.PM.mov

The 404 at the end of the video is intended behavior. Logging out requires a quartz redirect that we can't accomplish during testing, so the test focuses on the target URL, rather than the expected content of the login page.

Checklist

Authors and Reviewer(s), please verify the following:

  • A PR description, regardless of the triviality of this change, that communicates the value of this PR
  • Well-formatted conventional commit messages that provide context into the change
  • Documentation updated or issue created (provide link to issue/PR)
  • Signed CLA (if not already signed)
  • Feature flagged, if applicable - multi-Org

setSortedOrgs(alphaSortSelectedFirst(orgsList, currentActiveOrg))
}
}, [orgsList])

Copy link
Contributor Author

@wdoconnell wdoconnell Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These conditionals ensure that we don't render a non-functional globalheader to the user in the case where quartz endpoints fail. Rather than having an unpopulated dropdown or profile avatar, the global header will simply not render if quartz doesn't respond with the user's account and org info.

The figma doesn't specify one way or another, but I'd propose not sending a toast notification to the user in this case. If quartz goes down, the user won't be able to change accounts or orgs, but they may well be able to use other functionality like data explorer until quartz comes back online, and won't want to be pestered with notifications about switch-entity functionality that they are only using once in a while anyway.

@wdoconnell wdoconnell requested a review from a team August 17, 2022 13:45
@wdoconnell wdoconnell marked this pull request as ready for review August 17, 2022 13:45
@wdoconnell wdoconnell requested a review from a team as a code owner August 17, 2022 13:45
@wdoconnell wdoconnell force-pushed the billOC_multi-account_multi-org_e2e branch from 0782ffe to 761054a Compare August 17, 2022 17:01
Copy link
Contributor

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice! good job thinking over what happens when things aren't ideal!

@wdoconnell wdoconnell merged commit af30769 into master Aug 17, 2022
@wdoconnell wdoconnell deleted the billOC_multi-account_multi-org_e2e branch August 17, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi Org Phase 1 - End to End Testing

3 participants