-
Notifications
You must be signed in to change notification settings - Fork 114
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
[WIP][Paying for College] Remove jQuery from Disclosures app #7938
Conversation
|
||
return new Promise(function (resolve, reject) { | ||
// Completed xhr | ||
xhr.onreadystatechange = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could consider using fetch
instead of xhr
, which may simplify the request code. See https://github.com/cfpb/consumerfinance.gov/pull/7653/files for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip, now that I'm closer to done with this, I'll check out fetch
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #8008
2ebc683
to
ccb52de
Compare
- Add cyrpress tests to ensure there are no breaking changes - Add dollar-sign.js to cover jQuery functions - Remove jQuery functions where plain JS easily addresses issues
8840048
to
c5826f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Move disclosures to fetch-logic * set school_primary_alias once
Yep! I figured that out last week - it was because my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒
This PR will remove jQuery from the P4C "Dynamic Disclosures" app.
Originally, the intent was to add a bunch of cypress tests to verify the app's functionality, then remove all the jQuery, but after a long time trying to figure out why GHA failed all the cypress tests that passed locally, I finally found that it was the jQuery itself that was causing the GHA cypress failures, so we couldn't really write a PR with passing tests while the jQuery was in there.
Thus, this PR adds the cypress tests while also removing the jQuery. Not ideal, but it is easy enough to first verify the cypress tests pass with the existing code, then check again that they pass with this branch. See "How to test this PR" for a quick command to copy/paste to test the cypress in our
main
branch locally.Additions
dollar-sign.js
which is a vanilla replacement for some jQuery functionsRemovals
Changes
How to test this PR
disclosures
branchmain
branch, you can checkout just the cypress tests:git checkout disclosures -- test/cypress/fixtures/paying-for-college/ test/cypress/integration/paying-for-college/disclosures/
paying-for-college/disclosures
in your cypress interface) against themain
branch, where jQuery still reigns supreme. (Make sure your JS files are built in this branch before testing!)disclosures
branch, rebuild your JS files, and then try the cypress tests again!main
branch if you did thegit checkout
. - switching tomain
and doing agit clean -i
will get it done!Checklist