diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-03-17 08:44:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-17 08:44:15 +0300 |
commit | c5083d5fc372b750ceea35d72cafa26562762b0c (patch) | |
tree | 91ccd8f8a06dc8908dcd73036e8bdae2336e2808 /js/tests/unit/util | |
parent | c198eb6319d63c5414dbe3036ad160bd78d4cf01 (diff) |
Use more safe check for 'isDisabled' helper (#33385)
Diffstat (limited to 'js/tests/unit/util')
-rw-r--r-- | js/tests/unit/util/index.spec.js | 5 |
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 24921d730e..41c1ce2b80 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 ', () => { |