mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Taxon selectors and show/hide behaviour
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//= require angular-sanitize
|
||||
//= require angular-mocks
|
||||
//= require angular-cookies
|
||||
//= require angular-timer.min.js
|
||||
//= require angular-backstretch.js
|
||||
//= require lodash.underscore.js
|
||||
//= require angular-flash.min.js
|
||||
|
||||
@@ -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