Add directive spec to validate the dialog template is loaded on element click

This commit is contained in:
Luis Ramos
2020-10-01 23:04:11 +01:00
parent 1d1067ebc1
commit cf3f511f4d
2 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
describe "termsAndConditionsWarning", ->
element = null
templatecache = null
beforeEach ->
module('admin.enterprises')
inject ($rootScope, $compile, $templateCache) ->
templatecache = $templateCache
el = angular.element("<input terms-and-conditions-warning=\"true\"></input>")
element = $compile(el)($rootScope)
$rootScope.$digest()
describe "terms and conditions warning", ->
it "should load template", ->
spyOn(templatecache, 'get')
element.triggerHandler('click');
expect(templatecache.get).toHaveBeenCalledWith('admin/modals/terms_and_conditions_warning.html')