mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Taxon selectors and show/hide behaviour
This commit is contained in:
@@ -15,16 +15,22 @@ describe 'filtering by taxons', ->
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
beforeEach ->
|
||||
module 'Darkswarm'
|
||||
inject ($filter) ->
|
||||
filterByTaxons = $filter('taxons')
|
||||
|
||||
it "filters by nothing", ->
|
||||
expect(filterByTaxons(objects, [])).toBe objects
|
||||
|
||||
it "filters by primary taxon", ->
|
||||
expect(filterByTaxons(objects, 1)[0]).toBe objects[0]
|
||||
expect(filterByTaxons(objects, [1])[0]).toBe objects[0]
|
||||
|
||||
it "filters by taxons", ->
|
||||
expect(filterByTaxons(objects, 2)[0]).toBe objects[1]
|
||||
expect(filterByTaxons(objects, [2])[0]).toBe objects[1]
|
||||
|
||||
it "filters by multiple", ->
|
||||
expect(filterByTaxons(objects, [1, 2])[0]).toBe objects[0]
|
||||
expect(filterByTaxons(objects, [1, 2])[1]).toBe objects[1]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user