Skip to content

Commit

Permalink
Merge pull request #862 from CruGlobal/upgrade-angular
Browse files Browse the repository at this point in the history
[no-Jira] Upgrade AngularJS
  • Loading branch information
canac authored Nov 7, 2024
2 parents 9f67495 + eb155a4 commit e9ff6e6
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 62 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "1.0.0",
"dependencies": {
"@cruglobal/cru-payments": "^1.2.4",
"angular": "^1.6.4",
"angular-cookies": "^1.6.4",
"angular": "^1.8.3",
"angular-cookies": "^1.8.3",
"angular-environment": "^1.0.8",
"angular-gettext": "^2.3.8",
"angular-route": "^1.6.4",
"angular-sanitize": "^1.6.4",
"angular-gettext": "^2.4.2",
"angular-route": "^1.8.3",
"angular-sanitize": "^1.8.3",
"angular-ui-bootstrap": "^2.5.0",
"angular-ui-tree": "^2.4.0",
"angular-wysiwyg": "https://github.com/TerryMooreII/angular-wysiwyg.git#6b7961cc45d150cfb2a215eda0a0b97fd82b8509",
Expand Down Expand Up @@ -43,7 +43,7 @@
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/angular": "^1.8.2",
"@types/angular": "^1.8.3",
"@types/jest": "^29.2.5",
"@types/prop-types": "^15.7.4",
"@types/react": "^17.0.14",
Expand All @@ -52,7 +52,7 @@
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"angular-gettext-cli": "^1.2.0",
"angular-mocks": "^1.6.4",
"angular-mocks": "^1.8.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-angularjs-annotate": "^0.10.0",
Expand Down
2 changes: 2 additions & 0 deletions test/spec/controllers/eventDetails.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ describe('Controller: eventDetails', function () {
scope = $rootScope.$new();
$httpBackend = _$httpBackend_;

$httpBackend.whenGET(/^ministries|types$/).respond(200, []);

$controller('eventDetailsCtrl', {
$scope: scope,
conference: testData.conference,
Expand Down
22 changes: 10 additions & 12 deletions test/spec/controllers/paymentCashCheckReport.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ describe('Controller: paymentCashCheckReportCtrl', function () {
$httpBackend = _$httpBackend_;
scope = $rootScope.$new();

$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\/new\.*/)
.respond(201, testData.report);
$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report/)
.respond(201, testData.reports);

$controller('paymentCashCheckReportCtrl', {
$scope: scope,
report: testData.report,
Expand All @@ -32,12 +39,6 @@ describe('Controller: paymentCashCheckReportCtrl', function () {
it('refresh should call api and refresh scope data', function () {
scope.report = {};
scope.reports = [];
$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\/new\.*/)
.respond(201, testData.report);
$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\.*/)
.respond(201, testData.reports);

scope.refresh();
$httpBackend.flush();
Expand Down Expand Up @@ -99,6 +100,9 @@ describe('Controller: paymentCashCheckReportCtrl', function () {
.whenPOST(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\/lock\.*/, {})
.respond(201, 'locked-id');
scope.lock();
// Flush the lock request
$httpBackend.flush();
// Flush the refresh request triggered by lock updating the query parameters
$httpBackend.flush();

$httpBackend.verifyNoOutstandingExpectation();
Expand All @@ -114,14 +118,8 @@ describe('Controller: paymentCashCheckReportCtrl', function () {
$httpBackend
.expectGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\/new.*page=1.*/)
.respond(201, testData.report);
$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\.*/)
.respond(201, testData.reports);
$httpBackend.flush();
scope.queryParameters.page = 2;
$httpBackend
.whenGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report.*/)
.respond(201, testData.reports);
$httpBackend
.expectGET(/^conferences\/[-a-zA-Z0-9]+\/payments\/report\/new.*page=2.*/)
.respond(201, testData.reports);
Expand Down
4 changes: 4 additions & 0 deletions test/spec/directives/block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,14 @@ describe('Directive: blocks', () => {
expect($scope.answer.value).toBe('');

$scope.selectedAnswer = 'Option 1';
$scope.$digest();
$timeout.flush();

expect($scope.answer.value).toBe('Option 1');

$scope.selectedAnswer = '__other__';
$scope.otherAnswer = 'Other';
$scope.$digest();
$timeout.flush();

expect($scope.answer.value).toBe('Other');
Expand Down Expand Up @@ -464,12 +466,14 @@ describe('Directive: blocks', () => {
expect($scope.answer.value).toBe('');

$scope.selectedAnswer = 'Option 1';
$scope.$digest();
$timeout.flush();

expect($scope.answer.value).toBe('Option 1');

$scope.selectedAnswer = '__other__';
$scope.otherAnswer = 'Other';
$scope.$digest();
$timeout.flush();

expect($scope.answer.value).toBe('Other');
Expand Down
71 changes: 28 additions & 43 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2002,15 +2002,10 @@
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==

"@types/angular@^1.6.34":
version "1.8.4"
resolved "https://registry.yarnpkg.com/@types/angular/-/angular-1.8.4.tgz#a2cc163e508389c51d4c4119ebff6b9395cec472"
integrity sha512-wPS/ncJWhyxJsndsW1B6Ta8D4mi97x1yItSu+rkLDytU3oRIh2CFAjMuJceYwFAh9+DIohndWM0QBA9OU2Hv0g==

"@types/angular@^1.6.39", "@types/angular@^1.8.2":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@types/angular/-/angular-1.8.2.tgz#35d357097a853147a1b65ad34670322ca4e56b69"
integrity sha512-V0Hgx2Q3wFNcrrmx8zVepdasDuwnK4lqQFe0Zr9Ll3DoTJIuhKOpyfHC6KuVDBXJGgTkMKtELbvDe9crIkSGzg==
"@types/angular@^1.6.34", "@types/angular@^1.6.39", "@types/angular@^1.8.3":
version "1.8.9"
resolved "https://registry.yarnpkg.com/@types/angular/-/angular-1.8.9.tgz#d1ae3e87a67f72342d55ff26e611df83df0fb176"
integrity sha512-Z0HukqZkx0fotsV3QO00yqU9NzcQI+tMcrum+8MvfB4ePqCawZctF/gz6QiuII+T1ax+LitNoPx/eICTgnF4sg==

"@types/aria-query@^5.0.1":
version "5.0.1"
Expand Down Expand Up @@ -2619,10 +2614,10 @@ alphanum-sort@^1.0.1, alphanum-sort@^1.0.2:
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=

angular-cookies@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/angular-cookies/-/angular-cookies-1.6.4.tgz#c28f3f6aac7a9826c1e45f1d6807240036e5b26d"
integrity sha1-wo8/aqx6mCbB5F8daAckADblsm0=
angular-cookies@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/angular-cookies/-/angular-cookies-1.8.3.tgz#180a41e938926790630245d22c02a8d33d1409cc"
integrity sha512-uRd+zWgqiVnly7+YFRosM8E9tUQeY82dAZdtvonh/CeD/sf5SKN/BNIlMlHxZtoAk72ahTIjqUQGfeHdYcSsRQ==

angular-environment@^1.0.8:
version "1.0.8"
Expand Down Expand Up @@ -2651,25 +2646,25 @@ angular-gettext-tools@^2:
typescript "~2.0.3"
typescript-eslint-parser "^1.0.2"

angular-gettext@^2.3.8:
version "2.3.10"
resolved "https://registry.yarnpkg.com/angular-gettext/-/angular-gettext-2.3.10.tgz#f7125bf1a27b767037c204de352f3b144db9697c"
integrity sha1-9xJb8aJ7dnA3wgTeNS87FE25aXw=
angular-gettext@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/angular-gettext/-/angular-gettext-2.4.2.tgz#e5dde8df91493f826fd7eb8b5d6125a10cc0b681"
integrity sha512-J9Zy76VmN5otw6GyIqJjoLjl+0wwsZSCUPgPfQwM4Mx//hP3leqyS/fgf2MDiMLLyKgoHWkMMzzWbP4iH3+5vQ==

angular-mocks@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.6.4.tgz#47fdf50921cf24fb489f100a8cf2ad99d0538f40"
integrity sha1-R/31CSHPJPtInxAKjPKtmdBTj0A=
angular-mocks@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.8.3.tgz#c0dd05e5c3fc014e07af6289b23f0e817d7a4724"
integrity sha512-vqsT6zwu80cZ8RY7qRQBZuy6Fq5X7/N5hkV9LzNT0c8b546rw4ErGK6muW1u2JnDKYa7+jJuaGM702bWir4HGw==

angular-route@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/angular-route/-/angular-route-1.6.4.tgz#7bb216fcda746a1b8c452054b05900a7074ecc62"
integrity sha1-e7IW/Np0ahuMRSBUsFkApwdOzGI=
angular-route@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/angular-route/-/angular-route-1.8.3.tgz#f24a700ebd462454ca83a8b765df55c87a4edde1"
integrity sha512-kpIcRmDR2+o1FxDVVYy8Rvfab86/7LDbOgTRb9T+X9ewPQiBRuDEnZtM3oJYBiQLvAXDYTJXHV48n/bGE9Mv2g==

angular-sanitize@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/angular-sanitize/-/angular-sanitize-1.6.4.tgz#60a37ea96fb0d4a322a3ccb64ee4a5cf3b154f0c"
integrity sha1-YKN+qW+w1KMio8y2TuSlzzsVTww=
angular-sanitize@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/angular-sanitize/-/angular-sanitize-1.8.3.tgz#51378e990e78c7ecc1fb31cd68655aff690a3bf1"
integrity sha512-2rxdqzlUVafUeWOwvY/FtyWk1pFTyCtzreeiTytG9m4smpuAEKaIJAjYeVwWsoV+nlTOcgpwV4W1OCmR+BQbUg==

angular-ui-bootstrap@^2.5.0:
version "2.5.0"
Expand All @@ -2693,20 +2688,10 @@ angular2react@^3.0.2:
lodash.kebabcase "^4.1.1"
ngimport "^1.0.0"

angular@>=1.4.0:
version "1.7.9"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.7.9.tgz#e52616e8701c17724c3c238cfe4f9446fd570bc4"
integrity sha512-5se7ZpcOtu0MBFlzGv5dsM1quQDoDeUTwZrWjGtTNA7O88cD8TEk5IEKCTDa3uECV9XnvKREVUr7du1ACiWGFQ==

angular@>=1.5, angular@>=1.5.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.8.2.tgz#5983bbb5a9fa63e213cb7749199e0d352de3a2f1"
integrity sha512-IauMOej2xEe7/7Ennahkbb5qd/HFADiNuLSESz9Q27inmi32zB0lnAsFeLEWcox3Gd1F6YhNd1CP7/9IukJ0Gw==

angular@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.4.tgz#03b7b15c01a0802d7e2cf593240e604054dc77fb"
integrity sha1-A7exXAGggC1+LPWTJA5gQFTcd/s=
angular@>=1.4.0, angular@>=1.5, angular@>=1.5.0, angular@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.8.3.tgz#851ad75d5163c105a7e329555ef70c90aa706894"
integrity sha512-5qjkWIQQVsHj4Sb5TcEs4WZWpFeVFHXwxEBHUhrny41D8UrBAd6T/6nPPAsLngJCReIOqi95W3mxdveveutpZw==

ansi-colors@^3.0.0:
version "3.2.4"
Expand Down

0 comments on commit e9ff6e6

Please sign in to comment.