Repository navigation
feat: have user type name of thing to delete for extra safety - #4080
Conversation
|
this PR title made me smile, idk why :D |
| }) | ||
|
|
||
| it("disables confirm button when the text field is filled incorrectly", async () => { | ||
| const { t } = i18next |
| <Maybe condition={info !== undefined}> | ||
| <Typography className={styles.warning}>{info}</Typography> | ||
| </Maybe> | ||
| <Typography>{t("deleteDialog.confirm", { entity })}</Typography> |
There was a problem hiding this comment.
I love how we're not passing whole strings in so that the language will stay consistent.
| title, | ||
| description, | ||
| entity, | ||
| info, |
There was a problem hiding this comment.
What kind of info is this? A description?
There was a problem hiding this comment.
Yeah, it's intended to help the user identify the entity to delete, so they don't delete the wrong one by accident. @bpmct suggested this on the basis of an article about making the wrong repo private and thus losing all their github stars.
| fireEvent.click(moreButton) | ||
| const moreButtons = await screen.findAllByLabelText("more") | ||
| const suspendedMoreButton = moreButtons[2] | ||
| fireEvent.click(suspendedMoreButton) |
There was a problem hiding this comment.
Curious why we're using a fireEvent instead of an await user.click like above.
There was a problem hiding this comment.
It should be fine to do so - I just didn't make as many changes in this test. I wanted to switch to getting the "more" buttons everywhere because they load later than users, but the userEvent change was more of a hygiene thing than a cause of bugs.
Kira-Pilot
left a comment
There was a problem hiding this comment.
This was satisfying to review!!! Thanks for doing it.

Closes #3384