Test disposal of manually-created tooltips

This also prevents subsequent tests from failing due to the manual
tooltip never being removed from document.body.
This commit is contained in:
Nathan Sobo 2016-03-04 13:40:16 -07:00
parent 5dfd0c9102
commit d9ee94031f

View File

@ -29,8 +29,10 @@ describe "TooltipManager", ->
expect(document.body.querySelector(".tooltip")).toHaveText("Title")
it "creates a tooltip immediately if the trigger type is manual", ->
manager.add element, title: "Title", trigger: "manual"
disposable = manager.add element, title: "Title", trigger: "manual"
expect(document.body.querySelector(".tooltip")).toHaveText("Title")
disposable.dispose()
expect(document.body.querySelector(".tooltip")).toBeNull()
it "allows jQuery elements to be passed as the target", ->
element2 = document.createElement('div')