Commit 4891c90b authored by Randall Leeds's avatar Randall Leeds

Add test for default privacy setting

parent e29d7c5e
...@@ -85,6 +85,17 @@ describe 'h.directives.privacy', -> ...@@ -85,6 +85,17 @@ describe 'h.directives.privacy', ->
beforeEach -> beforeEach ->
store = $window.localStorage store = $window.localStorage
describe 'when no setting is stored', ->
beforeEach ->
store.removeItem VISIBILITY_KEY
it 'defaults to private', ->
$scope.permissions = {read: []}
$element = $compile('<privacy ng-model="permissions">')($scope)
$scope.$digest()
$isolateScope = $element.isolateScope()
assert.equal $isolateScope.level.name, VISIBILITY_PRIVATE
describe 'when permissions.read is empty', -> describe 'when permissions.read is empty', ->
beforeEach -> beforeEach ->
store.setItem VISIBILITY_KEY, VISIBILITY_PUBLIC store.setItem VISIBILITY_KEY, VISIBILITY_PUBLIC
......
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