diff options
| author | Johann-S <[email protected]> | 2018-11-08 13:43:23 +0100 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 57d50b2134077f3ef93757b52ddf51a86632e92c (patch) | |
| tree | 012581acfe8c3a7ae3ed5dc14af557a787253d51 /js/tests/unit | |
| parent | 6cfc78f2d95eca0b6fc6d0a19a76a1102f8c2254 (diff) | |
| download | bootstrap-57d50b2134077f3ef93757b52ddf51a86632e92c.tar.xz bootstrap-57d50b2134077f3ef93757b52ddf51a86632e92c.zip | |
Improve manipulator coverage
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/dom/manipulator.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/tests/unit/dom/manipulator.js b/js/tests/unit/dom/manipulator.js index 8a0be08ea..4b20529d4 100644 --- a/js/tests/unit/dom/manipulator.js +++ b/js/tests/unit/dom/manipulator.js @@ -41,16 +41,19 @@ $(function () { }) QUnit.test('should get data attributes', function (assert) { - assert.expect(2) + assert.expect(4) var $div = $('<div data-test="js" data-test2="js2" />').appendTo('#qunit-fixture') var $div2 = $('<div data-test3="js" data-test4="js2" />').appendTo('#qunit-fixture') + var $div3 = $('<div attri="1" />').appendTo('#qunit-fixture') assert.propEqual(Manipulator.getDataAttributes($div[0]), { test: 'js', test2: 'js2' }) + assert.propEqual(Manipulator.getDataAttributes(null), {}) + var stub = sinon .stub(Object, 'getOwnPropertyDescriptor') .callsFake(function () { @@ -62,6 +65,8 @@ $(function () { test4: 'js2' }) + assert.propEqual(Manipulator.getDataAttributes($div3[0]), {}) + stub.restore() }) |
