mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Reworking the tests for the new app
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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
|
||||
Reference in New Issue
Block a user