Skip to content

fix: stop SSHKeysPage from flaking #10553

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

Merged
merged 7 commits into from
Nov 7, 2023
Merged

fix: stop SSHKeysPage from flaking #10553

merged 7 commits into from
Nov 7, 2023

Conversation

Parkreiner
Copy link
Member

@Parkreiner Parkreiner commented Nov 6, 2023

Closes #10481
This fix updates SSHKeys.tsx to prevent its tests from flaking.

Changes made

  • Refactored <GlobalSnackbar> and useCustomEvent to simplify snackbar logic
  • Updated SSHKeys.tsx to process mutation errors solely through the snackbar, and not also the local UI
  • Updated Storybook to remove UI error logic, and updated the test to make selectors more semantics-based


useCustomEvent(SnackbarEventType, handleNotification);

const renderAdditionalMessage = (msg: AdditionalMessage, idx: number) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This got removed in favor of making it a separate component at the bottom of the file

@@ -87,26 +42,27 @@ export const GlobalSnackbar: FC = () => {
key={notification.msg}
open={open}
variant={variantFromMsgType(notification.msgType)}
onClose={() => setOpen(false)}
autoHideDuration={notification.msgType === MsgType.Error ? 22000 : 6000}
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
Copy link
Member Author

Choose a reason for hiding this comment

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

All the prop changes here are just moving the single-line prop definitions so they're grouped together

Copy link
Member

Choose a reason for hiding this comment

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

it's the little things ✨

@Parkreiner Parkreiner requested review from a team and aslilac and removed request for a team November 6, 2023 19:47
@@ -87,26 +42,27 @@ export const GlobalSnackbar: FC = () => {
key={notification.msg}
open={open}
variant={variantFromMsgType(notification.msgType)}
onClose={() => setOpen(false)}
autoHideDuration={notification.msgType === MsgType.Error ? 22000 : 6000}
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
Copy link
Member

Choose a reason for hiding this comment

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

it's the little things ✨

@Parkreiner Parkreiner merged commit 8c3828b into main Nov 7, 2023
@Parkreiner Parkreiner deleted the mes/flake/SSHKeyPage branch November 7, 2023 13:31
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: SSHKeyPage.test.tsx has too many element matches
2 participants