Skip to content

Commit b342834

Browse files
committed
ACP2E-4337: Configuration With Dependency Config Editable When Use Default Checked in Store Configuration
1 parent 1355a28 commit b342834

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

dev/tests/js/jasmine/tests/lib/mage/adminhtml/form.test.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 Adobe
2+
* Copyright 2025 Adobe
33
* All Rights Reserved.
44
*/
55

@@ -47,6 +47,33 @@ define([
4747
if (window.Event) {
4848
window.Event.observe = function () {};
4949
}
50+
// Stub Prototype's $ to return a fake target implementing up().select() chain
51+
var originalDollar = window.$;
52+
var fakeTarget = {
53+
id: 'test_input_dependent',
54+
type: 'input',
55+
tagName: 'INPUT',
56+
getAttribute: function () {
57+
return null;
58+
},
59+
show: function () {},
60+
hide: function () {},
61+
up: function () {
62+
return {
63+
show: function () {},
64+
hide: function () {},
65+
select: function () {
66+
return [cssDisabled, normalInput];
67+
}
68+
};
69+
}
70+
};
71+
window.$ = function (id) {
72+
if (id === 'test_input_dependent') {
73+
return fakeTarget;
74+
}
75+
return document.getElementById(id);
76+
};
5077
/* eslint-disable no-new */
5178
new window.FormElementDependenceController({
5279
'test_input_dependent': {
@@ -66,6 +93,9 @@ define([
6693
if (window.Event && originalObserve) {
6794
window.Event.observe = originalObserve;
6895
}
96+
if (originalDollar) {
97+
window.$ = originalDollar;
98+
}
6999
document.body.removeChild(container);
70100
document.body.removeChild(source);
71101
});

0 commit comments

Comments
 (0)