mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Dereferencing groups and adding modals to page
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
describe "Groups service", ->
|
||||
Groups = null
|
||||
Enterprises = null
|
||||
CurrentHubMock = {}
|
||||
groups = [{
|
||||
id: 1
|
||||
name: "Test Group"
|
||||
enterprises: [
|
||||
{id: 1},
|
||||
{id: 2}
|
||||
]
|
||||
}]
|
||||
enterprises = [
|
||||
{id: 1, name: "Test 1", groups: [{id: 1}]},
|
||||
{id: 2, name: "Test 2", groups: [{id: 1}]}
|
||||
]
|
||||
|
||||
beforeEach ->
|
||||
module 'Darkswarm'
|
||||
angular.module('Darkswarm').value('groups', groups)
|
||||
angular.module('Darkswarm').value('enterprises', enterprises)
|
||||
module ($provide)->
|
||||
$provide.value "CurrentHub", CurrentHubMock
|
||||
null
|
||||
inject (_Groups_, _Enterprises_)->
|
||||
Groups = _Groups_
|
||||
Enterprises = _Enterprises_
|
||||
|
||||
it "dereferences group enterprises", ->
|
||||
expect(Groups.groups[0].enterprises[0]).toBe enterprises[0]
|
||||
|
||||
it "dereferences enterprise groups", ->
|
||||
expect(Enterprises.enterprises[0].groups[0]).toBe groups[0]
|
||||
Reference in New Issue
Block a user