mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-23 01:03:21 +00:00
Moving taxon filter to ID instead of name
This commit is contained in:
committed by
Rohan Mitchell
parent
8b98c72336
commit
e858c0d434
@@ -5,11 +5,12 @@ describe 'filtering by taxons', ->
|
||||
taxons: []
|
||||
primary_taxon:
|
||||
name: "frogs"
|
||||
id: 1
|
||||
}
|
||||
{
|
||||
taxons: [
|
||||
{name: "kittens"}
|
||||
{name: "puppies"}
|
||||
{name: "kittens", id: 2}
|
||||
{name: "puppies", id: 3}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -21,7 +22,9 @@ describe 'filtering by taxons', ->
|
||||
filterByTaxons = $filter('taxons')
|
||||
|
||||
it "filters by primary taxon", ->
|
||||
expect(filterByTaxons(objects, "frogs")[0]).toBe objects[0]
|
||||
expect(filterByTaxons(objects, 1)[0]).toBe objects[0]
|
||||
|
||||
it "filters by taxons", ->
|
||||
expect(filterByTaxons(objects, "kittens")[0]).toBe objects[1]
|
||||
expect(filterByTaxons(objects, 2)[0]).toBe objects[1]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user