Skip to content

Commit

Permalink
Add sytem spec for product preview on product edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
rioug committed Sep 10, 2024
1 parent 9f70307 commit 2956f20
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/system/admin/products_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,28 @@
end

it "editing a product" do
login_as_admin
visit spree.edit_admin_product_path product

fill_in_trix_editor 'product_description', with: 'A description...'

click_button 'Update'

expect(flash_message).to eq('Product "a product" has been successfully updated!')
product.reload
expect(product.description).to eq("<div>A description...</div>")

# Product preview
click_link 'Preview'

within "#product-preview-modal" do
expect(page).to have_content("Product preview")
expect(page).to have_selector("h3 a span", text: "a product")

click_button "Close"
end

expect(page).not_to have_content("Product preview")
end

it "editing product group buy options" do
Expand Down

0 comments on commit 2956f20

Please sign in to comment.