Commit 68dfc650 authored by Sean Hammond's avatar Sean Hammond

Add tests for ThreadController.isNew()

parent 21346a25
......@@ -42,6 +42,25 @@ describe 'thread', ->
describe 'controller', ->
it 'returns true from isNew() for a new annotation', ->
createDirective()
# When the user clicks to create a new annotation in the browser, we get
# a ThreadController with a container with a message (the annotation)
# with no id.
controller.container = {message: {}}
assert(controller.isNew())
it 'returns false from isNew() for an old annotation', ->
createDirective()
# When we create a ThreadController for an old annotation, the controller
# has a container with a message (the annotation) with an id.
controller.container = {message: {id: 123}}
assert(not controller.isNew())
describe '#toggleCollapsed', ->
count = null
......
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