Skip to content

Commit

Permalink
Merge pull request #1996 from tvdeyen/fix-element-copy
Browse files Browse the repository at this point in the history
Fix copy element feature
  • Loading branch information
tvdeyen authored Jan 12, 2021
2 parents 071321e + 0798c22 commit 8072c97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/elements/_element_toolbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% remarkable_type = element.class.name.demodulize.underscore.pluralize %>
<% remarkable_type = "elements" %>
<div class="element-toolbar">
<span class="element_tools">
<div class="button_with_label">
Expand Down
13 changes: 13 additions & 0 deletions spec/features/admin/edit_elements_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,17 @@
expect(page).to have_selector(".add-nestable-element-button")
end
end

describe "Copy element", :js do
let!(:element) { create(:alchemy_element, page: a_page) }

scenario "is possible to copy element into clipboard" do
visit alchemy.admin_elements_path(page_id: element.page_id)
expect(page).to have_selector(".element-toolbar")
find(".fa-clone").click
within "#flash_notices" do
expect(page).to have_content(/Copied Article/)
end
end
end
end

0 comments on commit 8072c97

Please sign in to comment.