Skip to content

Commit

Permalink
Merge pull request #2718 from tvdeyen/harden-element-spec
Browse files Browse the repository at this point in the history
Harden edit elements feature spec
  • Loading branch information
tvdeyen authored Feb 8, 2024
2 parents 5d4c6d5 + f370962 commit 3e2bd7b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions spec/features/admin/edit_elements_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@
end
end

scenario "the add button opens add element form with the clipboard tab" do
scenario "the add button opens add element form with the clipboard tab", :js do
visit alchemy.admin_elements_path(page_version_id: element.page_version_id)
button = page.find(".add-nestable-element-button")
expect(button).to have_content "Add Slide"
button.click
expect(page).to have_select("Element")
expect(page).to have_css("[panel='paste_element_tab']")

expect(page).to have_css(".alchemy-dialog")
within ".alchemy-dialog" do
expect(page).to have_select("Element")
expect(page).to have_css("[panel='paste_element_tab']")
end
end
end

Expand All @@ -92,8 +96,11 @@

scenario "the add button now opens add element form with the clipboard tab" do
find("a.add-nestable-element-button").click
expect(page).to have_select("Element")
expect(page).to have_css("[panel='paste_element_tab']")
expect(page).to have_css(".alchemy-dialog")
within ".alchemy-dialog" do
expect(page).to have_select("Element")
expect(page).to have_css("[panel='paste_element_tab']")
end
end
end
end
Expand All @@ -112,8 +119,9 @@
button = page.find(".add-nestable-element-button")
expect(button).to have_content "New element"
button.click
expect(page).to have_select("Element")
expect(page).to have_css(".alchemy-dialog")
within ".alchemy-dialog" do
expect(page).to have_select("Element")
select2("Text", from: "Element")
click_button("Add")
end
Expand Down

0 comments on commit 3e2bd7b

Please sign in to comment.