Skip to content

Commit

Permalink
Merge duplicate test.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Sep 15, 2021
1 parent ed62ab6 commit 77e0855
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions js/tests/unit/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ $(function () {
})

QUnit.test('should show dropdown', function (assert) {
assert.expect(2)
assert.expect(3)

var dropdownHTML =
'<div class="dropdown">' +
Expand All @@ -1248,6 +1248,7 @@ $(function () {
$dropdown
.parent('.dropdown')
.on('show.bs.dropdown', function () {
assert.strictEqual(dropdown._popper, null)
assert.ok(true, 'show was fired')
})
.on('shown.bs.dropdown', function () {
Expand Down Expand Up @@ -1335,39 +1336,6 @@ $(function () {
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) {
assert.expect(1)

Expand Down

0 comments on commit 77e0855

Please sign in to comment.