Skip to content

Commit

Permalink
test: another update
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef-Rousset committed Nov 6, 2024
1 parent adcf21f commit 9b50298
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@
before do
component.unpublish!
end

let(:image_url) { "https://unsplash.com/fr/photos/une-trainee-detoiles-est-vue-dans-le-ciel-au-dessus-de-locean-pjHseB_JLpg" }
let(:router) { Decidim::EngineRouter.main_proxy(component) }
let(:description_with_image) do
{
en:
<<~HTML
<p><img src="http://mon_image.png"></p>
HTML
"en" => "<p><img src=\"#{image_url}\"</p>",
"ca" => "<p><img src=\"#{image_url}\"</p>",
"es" => "<p><img src=\"#{image_url}\"</p>"
}
end

let!(:question) { create(:questionnaire_question, description: description_with_image, questionnaire: questionnaire) }

it "after save, it renders description with hidden input value filled" do
Capybara.ignore_hidden_elements = false
visit questionnaire_edit_path
click_button "Save"
click_button "Expand all"
expect(page).to have_selector("img[src='#{image_url}']")
within "#questionnaire_question_#{question.id}-field" do
within "#questionnaire_question_#{question.id}-description-panel-0" do
input = page.find("#questionnaire_questions_#{question.id}_description_en")
expect(input.value).to eq('<p><img src="http://mon_image.png"></p>')
expect(input.value).to eq("<p><img src=\"#{image_url}\"></p>")
end
end
end
Expand Down

0 comments on commit 9b50298

Please sign in to comment.