mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
25 lines
632 B
CoffeeScript
25 lines
632 B
CoffeeScript
describe "SidebarCtrl", ->
|
|
ctrl = null
|
|
scope = null
|
|
location = null
|
|
|
|
beforeEach ->
|
|
module("Darkswarm")
|
|
location =
|
|
path: ->
|
|
"/test"
|
|
inject ($controller, $rootScope) ->
|
|
scope = $rootScope
|
|
ctrl = $controller 'SidebarCtrl', {$scope: scope, $location: location}
|
|
scope.$apply()
|
|
|
|
it 'tracks the active sidebar from the $location', ->
|
|
expect(scope.active_sidebar).toEqual "/test"
|
|
|
|
it 'is active when a location is set', ->
|
|
expect(scope.active()).toEqual "active"
|
|
|
|
it 'is inactive no location is set', ->
|
|
scope.active_sidebar = null
|
|
expect(scope.active()).toEqual null
|