Skip to content

Commit

Permalink
CDPT-1399 Hide feedback form (#2410)
Browse files Browse the repository at this point in the history
  • Loading branch information
vertism authored Jun 28, 2024
1 parent ddda391 commit 5e12608
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 16 deletions.
19 changes: 12 additions & 7 deletions app/views/feedback/_new.html.slim
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
hr
.grid-row
.column-two-thirds
.feedback
.feedback-notification
= form_for Feedback.new, url: feedback_path, remote: true do|f|
= f.text_area :comment, {rows: 4}
= f.submit t('button.feedback'), {class: 'button-secondary'}
details#feedback
summary
span.summary
= "Help make this service better"

.grid-row
.column-two-thirds
.feedback
.feedback-notification
= form_for Feedback.new, url: feedback_path, remote: true do|f|
= f.text_area :comment, {rows: 4, label: nil}
= f.submit t('button.feedback'), {class: 'button-secondary'}
5 changes: 1 addition & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,6 @@ en:
escalation_emails: Add multiple email addresses on separate lines
data_request:
location: Where is the data held?
feedback:
comment: |
Let us know what you were doing and what could be improved or fixed.
ico:
original_case_number_html: |
Enter original case reference number to link to. For example 170131001.<br>
Expand Down Expand Up @@ -955,7 +952,7 @@ en:
timeliness: Timeliness
not_applicable: Not applicable
feedback:
comment: Help make this service better
comment: Let us know what you were doing and what could be improved or fixed.
search_query:
business_unit_name_filter: Business unit
business_group:
Expand Down
4 changes: 4 additions & 0 deletions spec/features/common/feedback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
login_as responder
cases_page.load
expect(cases_page).to have_service_feedback

cases_page.service_feedback.details_button.click
expect(cases_page.service_feedback).to have_feedback_form
expect(cases_page.service_feedback).to have_send_button

Expand All @@ -27,6 +29,8 @@
cases_page.load

expect(cases_page).to have_service_feedback
cases_page.service_feedback.details_button.click

expect(cases_page.service_feedback).to have_feedback_form
expect(cases_page.service_feedback).to have_send_button

Expand Down
2 changes: 1 addition & 1 deletion spec/site_prism/page_objects/pages/admin/cases_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CasesPage < SitePrism::Page
element :who_its_with, 'td[aria-label="With"]'
end

section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, ".feedback"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, "#feedback"
section :primary_navigation, PageObjects::Sections::PrimaryNavigationSection, ".global-nav"

section :pagination, PageObjects::Sections::PaginationSection, ".pagination"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IncomingCasesPage < SitePrism::Page
end
end

section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, ".feedback"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, "#feedback"
section :primary_navigation, PageObjects::Sections::PrimaryNavigationSection, ".global-nav"
section :homepage_navigation, PageObjects::Sections::HomepageNavigationSection, "#homepage-navigation"

Expand Down
2 changes: 1 addition & 1 deletion spec/site_prism/page_objects/pages/cases_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CasesPage < PageObjects::Pages::Base

element :remove_original_link, ".js-remove-original"
element :new_case_button, 'a.button[href="/cases/new"]'
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, ".feedback"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, "#feedback"
section :primary_navigation, PageObjects::Sections::PrimaryNavigationSection, ".global-nav"

section :pagination, PageObjects::Sections::PaginationSection, ".pagination"
Expand Down
2 changes: 1 addition & 1 deletion spec/site_prism/page_objects/pages/login_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class LoginPage < SitePrism::Page
element :error_message, ".error-summary"
element :notice, ".notice-summary"
section :user_card, PageObjects::Sections::UserCardSection, ".user-card"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, ".feedback"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, "#feedback"
section :primary_navigation, PageObjects::Sections::PrimaryNavigationSection, ".global-nav"

def log_in(username, password)
Expand Down
2 changes: 1 addition & 1 deletion spec/site_prism/page_objects/pages/password_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PasswordPage < SitePrism::Page
element :email_field, "#user_email"
element :send, 'input[type="submit"][value="Send me password reset instructions"]'
element :error_message, ".error-summary"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, ".feedback"
section :service_feedback, PageObjects::Sections::ServiceFeedbackSection, "#feedback"
section :primary_navigation, PageObjects::Sections::PrimaryNavigationSection, ".global-nav"

def send_reset_instructions(email)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module PageObjects
module Sections
class ServiceFeedbackSection < SitePrism::Section
element :details_button, "summary"

element :feedback_form, "#new_feedback"
element :feedback_textarea, "#new_feedback textarea"

Expand Down

0 comments on commit 5e12608

Please sign in to comment.