tooltip.spec.js 29.5 KB
Newer Older
Johann-S's avatar
Johann-S committed
1001
1002
1003
1004
1005
1006
1007

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

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

1008
      jQueryMock.fn.tooltip = Tooltip.jQueryInterface
Johann-S's avatar
Johann-S committed
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
      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