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

upgrade react-router-dom dependency #18762

Merged
merged 3 commits into from Sep 17, 2021
Merged

Conversation

jhonnyoddball
Copy link
Contributor

Description

Minor upgrade. No breaking changes.

Original issue(s)

department-of-veterans-affairs/va.gov-team#28952

Testing done

Locally

Screenshots

Acceptance criteria

  • [ ]

Definition of done

  • Events are logged appropriately
  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs

@jhonnyoddball jhonnyoddball requested a review from a team September 16, 2021 20:42
@va-vfs-bot va-vfs-bot temporarily deployed to master/upgrade-react-router-dom/master September 16, 2021 21:00 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/upgrade-react-router-dom/master September 16, 2021 21:26 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/upgrade-react-router-dom/master September 17, 2021 12:47 Inactive
@jhonnyoddball jhonnyoddball requested a review from a team as a code owner September 17, 2021 14:00
@va-vfs-bot va-vfs-bot temporarily deployed to vetsgov-upgrade-react-r-kp85ew September 17, 2021 14:00 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/upgrade-react-router-dom/master September 17, 2021 14:01 Inactive
userEvent.click(screen.getByText(/View your appointments/i));
expect(screen.history.push.called).to.be.true;
expect(screen.history.push.getCall(0).args[0]).to.equal('/');
expect(screen.getByText(/View your appointments/i)).to.have.attribute(
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests were breaking due to remix-run/react-router#5362

For the tests that were breaking, we were rendering a page outside of our normal route structure, so the url of the page being tested wasn't the actual url, it was just /. This means that some of our links back to the homepage looked to react-router like we were going from / to /, which now doesn't generate a history push. We were testing the link clicks by looking for a push.

Instead, I've updated them to just look at the href and not click when we don't care about switching to another page, and looking for a history replace when we do care about the next page.

@jhonnyoddball jhonnyoddball merged commit 85430f8 into master Sep 17, 2021
@jhonnyoddball jhonnyoddball deleted the upgrade-react-router-dom branch September 17, 2021 14:58
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.

None yet

4 participants