Skip to content

Commit

Permalink
Add a bit more testing for new design of contact us page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Dec 13, 2023
1 parent 8bb5523 commit 01fd2bf
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions spec/features/contact_us_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
context "when signed in" do
let(:user) { create(:confirmed_user, name: "Matthew Landauer", email: "[email protected]") }

before { sign_in user }
before do
sign_in user
visit "/help/contact"
end

it "less information needs to be filled out and the admins receive an email" do
visit "/help/contact"
select "The address or map location is wrong", from: "I'm getting in touch because"
fill_in "Please tell us briefly about your request", with: "Actually nothing is wrong here. Sorry."
click_button "Send message to the Planning Alerts team"
Expand All @@ -49,4 +51,23 @@
expect(current_email).to have_reply_to("[email protected]")
end
end

context "when signed in in new theme" do
let(:user) { create(:confirmed_user, name: "Matthew Landauer", email: "[email protected]", tailwind_theme: true) }

before do
sign_in user
visit "/help/contact"
end

it "passes automated accessibility tests", js: true do
expect(page).to be_axe_clean
end

# rubocop:disable RSpec/NoExpectationExample
it "renders a snapshot for a visual diff", js: true do
page.percy_snapshot("Contact us")
end
# rubocop:enable RSpec/NoExpectationExample
end
end

0 comments on commit 01fd2bf

Please sign in to comment.