Skip to content

Commit 16cf008

Browse files
Update jquery
1 parent 3d293ed commit 16cf008

File tree

9 files changed

+16
-25
lines changed

9 files changed

+16
-25
lines changed

app/javascript/oldjs/import.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ window.ImportSetup = {
6565
listenForGitPostMessages: function() {
6666
window.addEventListener('message', function(event) {
6767
var messageData = event.data.message;
68-
69-
if (messageData.level === 'error') {
68+
if (messageData && messageData.level === 'error') {
7069
showErrorMessage(messageData.message);
7170
$('#git-url-import').prop('disabled', null);
7271
} else if (event.data.git_branches || event.data.git_tags) {

app/javascript/spec/ops-tenant-form/ops-tenant-form.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ describe('OpstTenantForm', () => {
5252
});
5353

5454
it('should mount and set initialValues', async(done) => {
55+
fetchMock.getOnce('/api/tenants?filter[]=name=&expand=resources', {
56+
resources: [],
57+
});
5558
fetchMock.getOnce('/api/tenants/123?expand=resources&attributes=name,description,use_config_for_attributes,ancestry,divisible', {
5659
name: 'foo',
5760
});

config/jest.setup.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ ManageIQ.redux.store.injectReducers();
5353

5454
Object.defineProperty(Array.prototype, 'flat', {
5555
value: function(depth = 1) {
56-
return this.reduce(function (flat, toFlatten) {
56+
let array = this;
57+
if (typeof this === 'object') {
58+
array = Object.keys(this).map((key) => this[key])
59+
}
60+
return array.reduce(function (flat, toFlatten) {
5761
return flat.concat((Array.isArray(toFlatten) && (depth>1)) ? toFlatten.flat(depth-1) : toFlatten);
5862
}, []);
5963
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"eonasdan-bootstrap-datetimepicker": "~4.17.49",
7373
"es6-shim": "~0.35.3",
7474
"history": "^4.7.2",
75-
"jquery": "~2.2.4",
75+
"jquery": "~3.7.1",
7676
"jquery-ui": "~1.13.2",
7777
"jquery-ujs": "~1.2.2",
7878
"jquery.hotkeys": "~0.1.0",
@@ -186,6 +186,7 @@
186186
"bootstrap-select": "~1.13.18",
187187
"decode-uri-component": "^0.2.2",
188188
"express": "^4.18.2",
189+
"jquery": "~3.7.1",
189190
"lodash": "~4.17.21",
190191
"minimatch": "~3.1.2",
191192
"moment": "^2.29.2",

spec/javascripts/automate_import_export_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ describe('Automate', function() {
263263
it('refreshes the selectpicker for git-branches and git-tags', function() {
264264
Automate.renderGitImport(['branches'], ['tags'], '123', {message: 'the message', level: 'warning'});
265265
expect($.fn.selectpicker.calls.allArgs()).toEqual([['refresh'], ['refresh']]);
266-
expect($.fn.selectpicker.calls.first().object.selector).toEqual('select.git-branches');
267-
expect($.fn.selectpicker.calls.mostRecent().object.selector).toEqual('select.git-tags');
266+
expect($.fn.selectpicker.calls.first().object[0].className).toEqual('git-branches');
267+
expect($.fn.selectpicker.calls.mostRecent().object[0].className).toEqual('git-tags');
268268
});
269269
});
270270

spec/javascripts/import_spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ describe('import.js', function() {
120120

121121
it('disables the git-url-import', function() {
122122
expect($.fn.prop).toHaveBeenCalledWith('disabled', null);
123-
expect($.fn.prop.calls.mostRecent().object.selector).toEqual('#git-url-import');
124123
});
125124

126125
it('turns the spinner off', function() {

spec/javascripts/miq_application_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('miq_application.js', function() {
66
});
77

88
it('verify serialize method doesnt convert line feed value to windows line feed', function() {
9-
expect(miqSerializeForm('form_div')).toEqual("method_data=new+line+added%0A%0A");
9+
expect(miqSerializeForm('form_div')).toEqual('method_data=new%20line%20added%0A%0A');
1010
});
1111
});
1212

spec/javascripts/services/miq_service_spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ describe('miqService', function() {
5757

5858
it('refreshes all selects', function() {
5959
testService.refreshSelectpicker();
60-
expect($.fn.selectpicker.calls.mostRecent().object.selector).toEqual('select');
6160
expect($.fn.selectpicker.calls.mostRecent().args[0]).toEqual('refresh');
6261
});
6362
});

yarn.lock

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10709,27 +10709,13 @@ __metadata:
1070910709
languageName: node
1071010710
linkType: hard
1071110711

10712-
"jquery@npm:1.8 - 4, jquery@npm:>=1.7, jquery@npm:>=1.7.0, jquery@npm:>=1.8.0 <4.0.0, jquery@npm:>=1.9.0, jquery@npm:>=3.4.0 <4.0.0, jquery@npm:^3.4.1, jquery@npm:^3.5.1":
10712+
"jquery@npm:~3.7.1":
1071310713
version: 3.7.1
1071410714
resolution: "jquery@npm:3.7.1"
1071510715
checksum: 10/17be9929f5fa37697d9848284f0d108c543318ef79ec794e130cd0c49f6c050d60c803a69e8cfa16fa19f5ff7cdb814a6905cceab0831186560c65ed113cd579
1071610716
languageName: node
1071710717
linkType: hard
1071810718

10719-
"jquery@npm:^2.2.4, jquery@npm:~2.2.4":
10720-
version: 2.2.4
10721-
resolution: "jquery@npm:2.2.4"
10722-
checksum: 10/fe1bb90423eda61255b969fed0420dfb09dc055793b83ad380a2fbe5b5ce3bc747029d010e580bf39c95bdd07fb309ef8c0fc22a700ca97015311626881db152
10723-
languageName: node
10724-
linkType: hard
10725-
10726-
"jquery@npm:~3.4.1":
10727-
version: 3.4.1
10728-
resolution: "jquery@npm:3.4.1"
10729-
checksum: 10/c40dcf94f6d1427b8d28b8f6b9d32f368b01e77cc24095c66c02de146faf0e633ef7c7f5d5815c52367b400f32d7c7f9c87e66d372488ffdd3276b4aeb6e0cef
10730-
languageName: node
10731-
linkType: hard
10732-
1073310719
"js-base64@npm:^2.1.9":
1073410720
version: 2.6.4
1073510721
resolution: "js-base64@npm:2.6.4"
@@ -11673,7 +11659,7 @@ __metadata:
1167311659
jasmine-jquery: "npm:~2.1.1"
1167411660
jest: "npm:~24.9.0"
1167511661
jest-cli: "npm:~24.9.0"
11676-
jquery: "npm:~2.2.4"
11662+
jquery: "npm:~3.7.1"
1167711663
jquery-ui: "npm:~1.13.2"
1167811664
jquery-ujs: "npm:~1.2.2"
1167911665
jquery.hotkeys: "npm:~0.1.0"

0 commit comments

Comments
 (0)