Commit 4102d301 authored by Sean Hammond's avatar Sean Hammond

Add tests for shouldShowThread()

parent 6ebf0412
......@@ -86,3 +86,34 @@ describe 'WidgetController', ->
assert.calledWith(loadSpy, [40..59])
assert.calledWith(loadSpy, [60..79])
assert.calledWith(loadSpy, [80..99])
describe 'shouldShowThread()', ->
it 'returns false for orphan annotations', ->
# Turn the 'show_unanchored_annotations' feature off.
$scope.feature = -> false
container =
message:
$orphan: true
assert($scope.shouldShowThread(container) is false)
it 'returns true for non-orphan annotations', ->
# Turn the 'show_unanchored_annotations' feature off.
$scope.feature = -> false
container =
message:
$orphan: false
assert($scope.shouldShowThread(container) is true)
it 'returns true for orphan annotations if show_unanchored_annotations is on', ->
# Turn the 'show_unanchored_annotations' feature on.
$scope.feature = -> true
container =
message:
$orphan: true
assert($scope.shouldShowThread(container) is true)
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