|
63 | 63 | expect(page).to have_text(I18n.t("fact_check_response.continue_button")) |
64 | 64 | expect(page).to have_checked_field(I18n.t("fact_check_response.correct"), visible: :all) |
65 | 65 | end |
| 66 | + |
| 67 | + it "allows the user to enter content into the factual error textbox and have it persist to confirmation" do |
| 68 | + visit respond_path |
| 69 | + |
| 70 | + expect(page).to have_text(I18n.t("fact_check_response.heading")) |
| 71 | + expect(page).to have_text(I18n.t("fact_check_response.form_heading")) |
| 72 | + expect(page).to have_text(I18n.t("fact_check_response.correct")) |
| 73 | + expect(page).to have_text(I18n.t("fact_check_response.incorrect")) |
| 74 | + expect(page).to have_button(I18n.t("fact_check_response.continue_button")) |
| 75 | + |
| 76 | + choose(I18n.t("fact_check_response.incorrect"), allow_label_click: true) |
| 77 | + page.fill_in "fact_check_details", with: "Fact check error detail test string" |
| 78 | + |
| 79 | + click_button(I18n.t("fact_check_response.continue_button")) |
| 80 | + |
| 81 | + expect(page).to have_text(I18n.t("fact_check_response.incorrect")) |
| 82 | + expect(page).to have_text(I18n.t("fact_check_verification.factual_errors")) |
| 83 | + expect(page).to have_text("Fact check error detail test string") |
| 84 | + end |
| 85 | + |
| 86 | + it "allows the user to click the change link without losing the detail contents for an incorrect response" do |
| 87 | + visit respond_path |
| 88 | + |
| 89 | + expect(page).to have_text(I18n.t("fact_check_response.heading")) |
| 90 | + expect(page).to have_text(I18n.t("fact_check_response.form_heading")) |
| 91 | + expect(page).to have_text(I18n.t("fact_check_response.correct")) |
| 92 | + expect(page).to have_text(I18n.t("fact_check_response.incorrect")) |
| 93 | + expect(page).to have_button(I18n.t("fact_check_response.continue_button")) |
| 94 | + |
| 95 | + choose(I18n.t("fact_check_response.incorrect"), allow_label_click: true) |
| 96 | + page.fill_in "fact_check_details", with: "Fact check error detail test string" |
| 97 | + |
| 98 | + click_button(I18n.t("fact_check_response.continue_button")) |
| 99 | + |
| 100 | + expect(page).to have_text(I18n.t("fact_check_response.incorrect")) |
| 101 | + expect(page).to have_text(I18n.t("fact_check_verification.factual_errors")) |
| 102 | + expect(page).to have_text("Fact check error detail test string") |
| 103 | + |
| 104 | + click_link(I18n.t("fact_check_verification.change_link"), match: :first) |
| 105 | + |
| 106 | + expect(page).to have_text(I18n.t("fact_check_response.heading")) |
| 107 | + expect(page).to have_text(I18n.t("fact_check_response.form_heading")) |
| 108 | + expect(page).to have_text(I18n.t("fact_check_response.correct")) |
| 109 | + expect(page).to have_text(I18n.t("fact_check_response.incorrect")) |
| 110 | + expect(page).to have_text(I18n.t("fact_check_response.continue_button")) |
| 111 | + expect(page).to have_checked_field(I18n.t("fact_check_response.incorrect"), visible: :all) |
| 112 | + expect(page).to have_text("Fact check error detail test string") |
| 113 | + end |
66 | 114 | end |
67 | 115 | end |
0 commit comments