Skip to content

Commit

Permalink
fix tests, fix form: Actions -> publish answer
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Mar 27, 2024
1 parent afe0e71 commit 41274ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div id="js-publish-answers-actions" class="hide js-bulk-action-form">
<%= form_tag(publish_answers_document_suggestions_path(document), method: :post, remote: true, id: "js-form-publish-answers", class: "flex--cc flex-gap--1") do %>
<%= form_tag(publish_answers_document_suggestions_path(document), method: :post, remote: true, id: "js-form-publish-answers", class: "form form-defaults flex items-center gap-x-2") do %>
<div class="checkboxes hide">
<% suggestions.each do |suggestion| %>
<%= check_box_tag "suggestion_ids[]", suggestion.id, false, class: "js-check-all-suggestion js-suggestion-id-#{suggestion.id}" %>
<% end %>
</div>
<p><%= t("decidim.participatory_documents.admin.suggestions.publish_answers.number_of_suggestions", number: '<span id="js-form-publish-answers-number"></span>').html_safe %></p>

<%= submit_tag(t("decidim.participatory_documents.admin.suggestions.index.actions.publish"), id: "js-submit-publish-answers", class: "button small button--simple float-left") %>
<%= submit_tag(t("decidim.participatory_documents.admin.suggestions.index.actions.publish"), id: "js-submit-publish-answers", class: "button button__sm button__secondary small button--simple float-left") %>

<button id="js-cancel-publish-answers" class="button tiny clear compact js-cancel-bulk-action" type="button"><%= t("decidim.participatory_documents.admin.suggestions.index.actions.cancel") %></button>
<button id="js-cancel-publish-answers" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button"><%= t("decidim.participatory_documents.admin.suggestions.index.actions.cancel") %></button>
<% end %>
</div>
28 changes: 14 additions & 14 deletions spec/system/user_interacts_with_pdf_viewer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

shared_examples "interacts with drawer" do
it "displays the drawer" do
expect(page).to have_css("#participation-modal")
expect(page).to have_css("#participationModal")
expect(page).to have_css("#participation-modal-form")
expect(page).to have_css("#suggestions-list")
end
Expand All @@ -25,7 +25,7 @@
let(:attributes) { { suggestable: sugested, author: user, answer:, answered_at: Time.zone.now, answer_is_published: published } }

it "displays only my suggestion" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_content(my_suggestion.body["en"])
expect(page).to have_no_content(other_suggestion.body["en"])
end
Expand All @@ -40,7 +40,7 @@

context "when the answer is draft" do
it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -50,7 +50,7 @@
let(:published) { true }

it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -62,7 +62,7 @@

context "when the answer is draft" do
it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -72,7 +72,7 @@
let(:published) { true }

it "renders admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_content(answer["en"])
end
end
Expand All @@ -84,7 +84,7 @@

context "when the answer is draft" do
it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -94,7 +94,7 @@
let(:published) { true }

it "renders admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -106,7 +106,7 @@

context "when the answer is draft" do
it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -116,7 +116,7 @@
let(:published) { true }

it "renders admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_content(answer["en"])
end
end
Expand All @@ -128,7 +128,7 @@

context "when the answer is draft" do
it "does not render admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_no_content(answer["en"])
end
end
Expand All @@ -138,7 +138,7 @@
let(:published) { true }

it "renders admin note" do
within "#participation-modal" do
within "#participationModal" do
expect(page).to have_content(answer["en"])
end
end
Expand Down Expand Up @@ -194,7 +194,7 @@
it "submits a box content" do
find("#box-#{section.annotations.first.id}").click
sleep 1
expect(page).to have_css("#participation-modal.active")
expect(page).to have_css("#participationModal.active")
expect(page).to have_no_content("upload a file")
expect(page).to have_content(t("activemodel.attributes.suggestion.body"))

Expand All @@ -213,7 +213,7 @@
it "submits a global content" do
click_link_or_button "Global suggestions"
sleep 1
expect(page).to have_css("#participation-modal.active")
expect(page).to have_css("#participationModal.active")
expect(page).to have_content("upload a file")
expect(page).to have_content(t("activemodel.attributes.suggestion.body"))

Expand Down

0 comments on commit 41274ec

Please sign in to comment.