Adding test

stable
Alejandro Alonso 2015-05-05 12:41:59 +02:00 committed by Juanfran
parent ffa635ad85
commit 0e4da5b483
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
describe "homeDirective", () ->
scope = compile = provide = null
mockTgHomeService = null
template = "<div ng-controller='HomePage' tg-home></div>"
createDirective = () ->
elm = compile(template)(scope)
return elm
_mockTgHomeService = () ->
mockTgHomeService = {
workInProgress: Immutable.fromJS({
assignedTo: {
userStories: [{"id": 1}]
tasks: []
issues: []
}
watching: {
userStories: []
tasks: []
issues: []
}
})
}
provide.value "tgHomeService", mockTgHomeService
_mocks = () ->
module ($provide) ->
provide = $provide
_mockTgHomeService()
return null
beforeEach ->
module "taigaHome"
_mocks()
inject ($rootScope, $compile) ->
scope = $rootScope.$new()
compile = $compile
it "home directive content", () ->
elm = createDirective()
console.log 111, elm, elm.find('div')