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

Identity Crisis: add unit tests for has_identity_crisis and get_mismatched_urls #21754

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

kbrown9
Copy link
Member

@kbrown9 kbrown9 commented Nov 16, 2021

Fixes #21656

Changes proposed in this Pull Request:

  • In Identity_Crisis::get_mismatched_urls, check that the jetpack_sync_error_idc option value has all of the required keys, and return false if it doesn't.
  • Add unit tests for the Identity_Crisis::has_identity_crisis and Identity_Crisis::get_mismatched_urls methods.

Jetpack product discussion

  • n/a

Does this pull request change what data or activity we track or use?

  • no

Testing instructions:

If testing with JN, you'll need this plugin activated.

  1. Install, activate, and connect this branch of Jetpack.
  2. Install the Jetpack Debug Helper plugin.
  3. In the Jetpack Debug dashboard, enable the Identity Crisis Simulation Utility module.
  4. In the IDC Simulator, enable the IDC Simulation. The siteurl and home values will now be mocked as example.org.
  5. Cause an IDC by editing a post.
  6. Navigate to the Tools -> Connection Manager. The IDC UI should be displayed. Verify that the IDC UI displays the correct URLs.

@kbrown9 kbrown9 added [Status] In Progress Unit Tests [Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. labels Nov 16, 2021
@kbrown9 kbrown9 self-assigned this Nov 16, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 16, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.

@kbrown9 kbrown9 added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Nov 16, 2021
@kbrown9 kbrown9 force-pushed the update/add_idc_unit_tests branch from 1ae6ac0 to 8033e49 Compare November 16, 2021 05:43
@kbrown9 kbrown9 removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Nov 16, 2021
@kbrown9 kbrown9 requested a review from sergeymitr November 16, 2021 14:19
@kbrown9 kbrown9 added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Nov 16, 2021
@kbrown9 kbrown9 added this to the jetpack/10.4 milestone Nov 16, 2021
…tched_urls

Also, in get_mismatched_urls, return false if the jetpack_sync_error_idc option is missing one of the
required keys.
@kbrown9 kbrown9 force-pushed the update/add_idc_unit_tests branch from e70df75 to d7e41a3 Compare November 16, 2021 21:42
Copy link
Contributor

@sergeymitr sergeymitr left a comment

Choose a reason for hiding this comment

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

Looks awesome, thanks Kim!

@sergeymitr sergeymitr added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 17, 2021
@kbrown9 kbrown9 merged commit 89ab418 into master Nov 17, 2021
@kbrown9 kbrown9 deleted the update/add_idc_unit_tests branch November 17, 2021 16:19
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 17, 2021
davidlonjon added a commit that referenced this pull request Nov 18, 2021
* master: (28 commits)
  Prepare for 10.4-a.7 (#21797)
  Check if maxwidth exists before trying to call .length (#21785)
  Podcast Player: Increase podcast shown (#21661)
  licensing: jetpack-js-test-runner is a dev dependency (#21794)
  Update dependency @mdn/browser-compat-data to v4.0.11 (#21792)
  Tests: Fix unit tests for wpcom (#21649)
  SSO: Fix Button Text Alignment on Mobile   (#18770)
  Add/my jetpack skeleton (#21464)
  Identity Crisis: add unit tests for has_identity_crisis and get_mismatched_urls (#21754)
  Remove special cases for calling changelogger on packages/changelogger (#21783)
  eslint-config-target-es: Release 1.0.0! (#21766)
  Revert "WPCOM no longer forces home_urls to be http" (#21769)
  WPCOM no longer forces home_urls to be http (#21747)
  Revert and fix "Revert "Assets: do not use the new method yet (#21760)"" (#21763)
  eslint-config-target-es: Fix README.md (#21743)
  codesniffer: Disable CI on PHP 8.1 (#21742)
  RNA Pricing card component: Fix case where prices before and after match (#21757)
  Janitorial: update Jetpack version for 10.4-a.6 cycle (#21762)
  Releases: prepare changelog for 10.4-a.5 release (#21758)
  Assets: do not use the new method yet (#21760)
  ...
davidlonjon added a commit that referenced this pull request Nov 19, 2021
* master: (28 commits)
  Prepare for 10.4-a.7 (#21797)
  Check if maxwidth exists before trying to call .length (#21785)
  Podcast Player: Increase podcast shown (#21661)
  licensing: jetpack-js-test-runner is a dev dependency (#21794)
  Update dependency @mdn/browser-compat-data to v4.0.11 (#21792)
  Tests: Fix unit tests for wpcom (#21649)
  SSO: Fix Button Text Alignment on Mobile   (#18770)
  Add/my jetpack skeleton (#21464)
  Identity Crisis: add unit tests for has_identity_crisis and get_mismatched_urls (#21754)
  Remove special cases for calling changelogger on packages/changelogger (#21783)
  eslint-config-target-es: Release 1.0.0! (#21766)
  Revert "WPCOM no longer forces home_urls to be http" (#21769)
  WPCOM no longer forces home_urls to be http (#21747)
  Revert and fix "Revert "Assets: do not use the new method yet (#21760)"" (#21763)
  eslint-config-target-es: Fix README.md (#21743)
  codesniffer: Disable CI on PHP 8.1 (#21742)
  RNA Pricing card component: Fix case where prices before and after match (#21757)
  Janitorial: update Jetpack version for 10.4-a.6 cycle (#21762)
  Releases: prepare changelog for 10.4-a.5 release (#21758)
  Assets: do not use the new method yet (#21760)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. Unit Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identity Crisis: add unit tests for a few methods
2 participants