0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

Merge duplicate test.

This commit is contained in:
XhmikosR 2020-11-27 14:14:32 +02:00
parent ed62ab6e41
commit 77e0855e5e

View File

@ -1227,7 +1227,7 @@ $(function () {
}) })
QUnit.test('should show dropdown', function (assert) { QUnit.test('should show dropdown', function (assert) {
assert.expect(2) assert.expect(3)
var dropdownHTML = var dropdownHTML =
'<div class="dropdown">' + '<div class="dropdown">' +
@ -1248,6 +1248,7 @@ $(function () {
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.on('show.bs.dropdown', function () { .on('show.bs.dropdown', function () {
assert.strictEqual(dropdown._popper, null)
assert.ok(true, 'show was fired') assert.ok(true, 'show was fired')
}) })
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
@ -1335,39 +1336,6 @@ $(function () {
assert.false($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is still hidden') assert.false($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is still hidden')
}) })
QUnit.test('should show dropdown', function (assert) {
assert.expect(3)
var dropdownHTML =
'<div class="dropdown">' +
' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' +
' <div class="dropdown-menu">' +
' <a class="dropdown-item" href="#">Another link</a>' +
' </div>' +
'</div>'
var $dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.bootstrapDropdown()
var dropdown = $dropdown.data('bs.dropdown')
var done = assert.async()
$dropdown
.parent('.dropdown')
.on('show.bs.dropdown', function () {
assert.strictEqual(dropdown._popper, null)
assert.ok(true, 'show was fired')
})
.on('shown.bs.dropdown', function () {
assert.true($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown')
done()
})
dropdown.show()
})
QUnit.test('should prevent default event on show method call', function (assert) { QUnit.test('should prevent default event on show method call', function (assert) {
assert.expect(1) assert.expect(1)