mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
11200: add spec for display producer column
This commit is contained in:
@@ -46,9 +46,19 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
|
||||
expect_other_columns_visible
|
||||
|
||||
# Producer is hidden by if only one producer is present
|
||||
expect(page).not_to have_checked_field "Producer"
|
||||
expect(page).to have_unchecked_field "Producer"
|
||||
expect(page).not_to have_selector "th", text: "Producer"
|
||||
|
||||
# Show Producer column
|
||||
ofn_drop_down("Columns").click
|
||||
within ofn_drop_down("Columns") do
|
||||
check "Producer"
|
||||
end
|
||||
|
||||
# Preference saved
|
||||
save_preferences
|
||||
expect(page).to have_selector "th", text: "Producer"
|
||||
|
||||
# Name is hidden
|
||||
ofn_drop_down("Columns").click
|
||||
within ofn_drop_down("Columns") do
|
||||
@@ -58,9 +68,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
|
||||
expect_other_columns_visible
|
||||
|
||||
# Preference saved
|
||||
click_on "Save as default"
|
||||
expect(page).to have_content "Column preferences saved"
|
||||
refresh
|
||||
save_preferences
|
||||
|
||||
# Preference remembered
|
||||
ofn_drop_down("Columns").click
|
||||
@@ -75,6 +83,13 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
|
||||
expect(page).to have_selector "th", text: "Price"
|
||||
expect(page).to have_selector "th", text: "On Hand"
|
||||
end
|
||||
|
||||
def save_preferences
|
||||
# Preference saved
|
||||
click_on "Save as default"
|
||||
expect(page).to have_content "Column preferences saved"
|
||||
refresh
|
||||
end
|
||||
end
|
||||
|
||||
context "with multiple producers" do
|
||||
|
||||
Reference in New Issue
Block a user