tooltip.spec.js 29.6 KB
Newer Older
Johann-S's avatar
Johann-S committed
1001
1002
1003
1004
1005
1006
1007
1008
1009
      expect(Tooltip.prototype.dispose).not.toHaveBeenCalled()
    })

    it('should throw error on undefined method', () => {
      fixtureEl.innerHTML = '<div></div>'

      const div = fixtureEl.querySelector('div')
      const action = 'undefinedMethod'

1010
      jQueryMock.fn.tooltip = Tooltip.jQueryInterface
Johann-S's avatar
Johann-S committed
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
      jQueryMock.elements = [div]

      try {
        jQueryMock.fn.tooltip.call(jQueryMock, action)
      } catch (error) {
        expect(error.message).toEqual(`No method named "${action}"`)
      }
    })
  })
})
For faster browsing, not all history is shown. View entire blame