aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-03-17 07:44:15 +0200
committerGitHub <[email protected]>2021-03-17 07:44:15 +0200
commitc5083d5fc372b750ceea35d72cafa26562762b0c (patch)
tree91ccd8f8a06dc8908dcd73036e8bdae2336e2808 /js/tests
parentc198eb6319d63c5414dbe3036ad160bd78d4cf01 (diff)
downloadbootstrap-c5083d5fc372b750ceea35d72cafa26562762b0c.tar.xz
bootstrap-c5083d5fc372b750ceea35d72cafa26562762b0c.zip
Use more safe check for 'isDisabled' helper (#33385)
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/util/index.spec.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js
index 24921d730..41c1ce2b8 100644
--- a/js/tests/unit/util/index.spec.js
+++ b/js/tests/unit/util/index.spec.js
@@ -347,16 +347,19 @@ describe('Util', () => {
expect(Util.isDisabled(div2)).toEqual(true)
})
- it('should return false if the element has disabled attribute with "false" value', () => {
+ it('should return false if the element has disabled attribute with "false" value, or doesn\'t have attribute', () => {
fixtureEl.innerHTML = [
'<div>',
' <div id="element" disabled="false"></div>',
+ ' <div id="element1" ></div>',
'</div>'
].join('')
const div = fixtureEl.querySelector('#element')
+ const div1 = fixtureEl.querySelector('#element1')
expect(Util.isDisabled(div)).toEqual(false)
+ expect(Util.isDisabled(div1)).toEqual(false)
})
it('should return false if the element is not disabled ', () => {