Skip to content

Commit

Permalink
Add an annotation-viewer-controller.coffee test
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed Jul 21, 2015
1 parent b628e83 commit 8a788fa
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"

0 comments on commit 8a788fa

Please sign in to comment.