mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-26 05:55:15 +00:00
Adding producers filtering and more Angular magic
This commit is contained in:
@@ -21,10 +21,10 @@ describe 'filtering Hubs', ->
|
||||
module 'Darkswarm'
|
||||
inject ($filter) ->
|
||||
filter = $filter
|
||||
filterHubs = $filter('filterHubs')
|
||||
filterHubs = $filter('hubs')
|
||||
|
||||
it 'has a hub filter', ->
|
||||
expect(filter('filterHubs')).not.toBeNull()
|
||||
expect(filter('hubs')).not.toBeNull()
|
||||
|
||||
it "filters by name", ->
|
||||
expect(filterHubs(hubs, 'donkeys').length).toEqual 1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
describe 'filtering producers', ->
|
||||
filter = null
|
||||
filterProducers = null
|
||||
producers = [{
|
||||
name: "frogs"
|
||||
other: "roger"
|
||||
address:
|
||||
zipcode: "cats"
|
||||
city: "cambridge"
|
||||
state: "kansas"
|
||||
}, {
|
||||
name: "donkeys"
|
||||
other: "roger"
|
||||
address:
|
||||
zipcode: ""
|
||||
city: "Wellington"
|
||||
state: "uzbekistan"
|
||||
}]
|
||||
|
||||
beforeEach ->
|
||||
module 'Darkswarm'
|
||||
inject ($filter) ->
|
||||
filter = $filter
|
||||
filterProducers = $filter('filterProducers')
|
||||
|
||||
|
||||
it 'has a producer filter', ->
|
||||
expect(filter('filterProducers')).not.toBeNull()
|
||||
Reference in New Issue
Block a user