1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-22 13:13:03 +02:00

Remove IE support and button bsChecked hack

This commit is contained in:
Alessandro Chitolina
2018-09-25 20:06:09 +02:00
committed by XhmikosR
parent e866b1ae43
commit 6cfc78f2d9
8 changed files with 8 additions and 133 deletions

View File

@@ -8,52 +8,6 @@ $(function () {
assert.ok(Manipulator, 'Manipulator is defined')
})
QUnit.test('should set checked for input', function (assert) {
assert.expect(2)
var $input = $('<input type="checkbox" />').appendTo('#qunit-fixture')
Manipulator.setChecked($input[0], true)
assert.ok($input[0].checked)
Manipulator.setChecked($input[0], false)
assert.ok(!$input[0].checked)
})
QUnit.test('should not set checked for non input element', function (assert) {
assert.expect(1)
var $div = $('<div />').appendTo('#qunit-fixture')
Manipulator.setChecked($div[0], true)
assert.ok(typeof $div[0].checked === 'undefined')
})
QUnit.test('should verify if an element is checked', function (assert) {
assert.expect(2)
var $input = $('<input type="checkbox" />').appendTo('#qunit-fixture')
Manipulator.setChecked($input[0], true)
assert.ok(Manipulator.isChecked($input[0]))
Manipulator.setChecked($input[0], false)
assert.ok(!Manipulator.isChecked($input[0]))
})
QUnit.test('should throw an error when the element is not an input', function (assert) {
assert.expect(1)
var $div = $('<div />').appendTo('#qunit-fixture')
try {
Manipulator.isChecked($div[0])
} catch (e) {
assert.strictEqual(e.message, 'INPUT parameter is not an HTMLInputElement')
}
})
QUnit.test('should set data attribute', function (assert) {
assert.expect(1)