Skip to content

Unit tests for the banners refactoring #4397

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

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Jun 5, 2025

Base PR #4328

Changes proposed in this Pull Request:

On the base PR I did a considerable refactoring of the promotional banners. I am adding unit tests for all the new JS files here to make the code more reliable.

Testing instructions

Code review. Check if the tests make sense and are still passing.


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Jun 5, 2025
@wjrosa wjrosa requested review from a team and Mayisha and removed request for a team June 5, 2025 14:14
@wjrosa wjrosa marked this pull request as ready for review June 5, 2025 14:15
Base automatically changed from add/new-banners-for-bnpl-upon-legacy-checkout-deprecation to develop June 5, 2025 16:36
Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

Things are looking good enough to me, with the exception of using the test IDs.

That said, might it be worth aiming for more integration-y tests that validate we see the expected banners in the main UI, and not just rely on lower-level unit tests? (That work could be tackled in a follow-up PR.)

value: { assign },
} );
} );
it( 'should create error notice when oauth URLs are invalid', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we test that we throw an error when the expected live and test URLs are null separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry, but I'm not sure if I understand. Do you mean move it to a separate describe clause?

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.

2 participants