Commit a2040d37 authored by Sean Hammond's avatar Sean Hammond

Add an annotation-viewer-controller.coffee test

parent 47a03b87
......@@ -30,13 +30,13 @@ describe "AnnotationViewerController", ->
$scope: $scope or {search: {}}
streamer: streamer or {send: ->}
store: store or {
AnnotationResource: {read: ->},
AnnotationResource: {read: sinon.spy()},
SearchResource: {get: ->}}
streamFilter: streamFilter or {
setMatchPolicyIncludeAny: -> {addClause: -> {addClause: ->}}
getFilter: ->
}
annotationMapper: annotationMapper or {}
annotationMapper: annotationMapper or {loadAnnotations: sinon.spy()}
}
locals["ctrl"] = getControllerService()(
"AnnotationViewerController", locals)
......@@ -45,3 +45,7 @@ describe "AnnotationViewerController", ->
it "sets the isEmbedded property to false", ->
{$scope} = createAnnotationViewerController({})
assert.isFalse($scope.isEmbedded)
it "calls the annotation API to get the annotation", ->
{store} = createAnnotationViewerController({})
assert store.AnnotationResource.read.args[0][0].id == "test_annotation_id"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment