mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Fix filter results bug in validation section
This commit is contained in:
@@ -10,7 +10,7 @@ angular.module("admin.productImport").filter 'entriesFilterValid', ->
|
||||
|
||||
if type == 'valid' and validates_as != '' \
|
||||
or type == 'invalid' and validates_as == '' \
|
||||
or type == 'create_product' and validates_as == 'new_product' or validates_as == 'new_variant' \
|
||||
or type == 'create_product' and (validates_as == 'new_product' or validates_as == 'new_variant') \
|
||||
or type == 'update_product' and validates_as == 'existing_variant' \
|
||||
or type == 'create_inventory' and validates_as == 'new_inventory_item' \
|
||||
or type == 'update_inventory' and validates_as == 'existing_inventory_item'
|
||||
|
||||
@@ -201,11 +201,12 @@ feature "Product Import", js: true do
|
||||
expect(Spree::Product.find_by_name('Beans').on_hand).to eq 0
|
||||
end
|
||||
|
||||
it "can save a new product and variant of that product at the same time" do
|
||||
it "can save a new product and variant of that product at the same time, add variant to existing product" do
|
||||
csv_data = CSV.generate do |csv|
|
||||
csv << ["name", "supplier", "category", "on_hand", "price", "units", "unit_type", "display_name"]
|
||||
csv << ["Potatoes", "User Enterprise", "Vegetables", "5", "3.50", "500", "g", "Small Bag"]
|
||||
csv << ["Potatoes", "User Enterprise", "Vegetables", "6", "5.50", "2", "kg", "Big Bag"]
|
||||
csv << ["Beans", "User Enterprise", "Vegetables", "7", "2.50", "250", "g", nil]
|
||||
end
|
||||
File.write('/tmp/test.csv', csv_data)
|
||||
|
||||
@@ -215,9 +216,9 @@ feature "Product Import", js: true do
|
||||
|
||||
import_data
|
||||
|
||||
expect(page).to have_selector '.item-count', text: "2"
|
||||
expect(page).to have_selector '.item-count', text: "3"
|
||||
expect(page).to_not have_selector '.invalid-count'
|
||||
expect(page).to have_selector '.create-count', text: "2"
|
||||
expect(page).to have_selector '.create-count', text: "3"
|
||||
expect(page).to_not have_selector '.update-count'
|
||||
expect(page).to_not have_selector '.update-count'
|
||||
expect(page).to_not have_selector '.inv-create-count'
|
||||
|
||||
Reference in New Issue
Block a user