diff --git a/app/modules/home/home.directive.spec.coffee b/app/modules/home/home.directive.spec.coffee new file mode 100644 index 00000000..648733b3 --- /dev/null +++ b/app/modules/home/home.directive.spec.coffee @@ -0,0 +1,45 @@ +describe "homeDirective", () -> + scope = compile = provide = null + mockTgHomeService = null + template = "
" + + 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')