2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

v4 improve coverage (#25945)

* Improve code coverage for our Button plugin

* improve coverage for our Alert plugin

* test tooltip update method

* test update and dispose for dropdown

* increase code coverage requirements
This commit is contained in:
Johann-S
2018-04-10 09:28:29 +02:00
committed by GitHub
parent 875ed0b975
commit 0871d69ec9
7 changed files with 214 additions and 7 deletions
+29
View File
@@ -953,4 +953,33 @@ $(function () {
$trigger.trigger($.Event('click'))
}, 200)
})
QUnit.test('should call Popper.js to update', function (assert) {
assert.expect(2)
var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>')
.appendTo('#qunit-fixture')
.bootstrapTooltip()
var tooltip = $tooltip.data('bs.tooltip')
tooltip.show()
assert.ok(tooltip._popper)
var spyPopper = sinon.spy(tooltip._popper, 'scheduleUpdate')
tooltip.update()
assert.ok(spyPopper.called)
})
QUnit.test('should not call Popper.js to update', function (assert) {
assert.expect(1)
var $tooltip = $('<a href="#" rel="tooltip" data-trigger="click" title="Another tooltip"/>')
.appendTo('#qunit-fixture')
.bootstrapTooltip()
var tooltip = $tooltip.data('bs.tooltip')
tooltip.update()
assert.ok(tooltip._popper === null)
})
})