phlask / phlask-map

Code behind the Phlask Web Map
https://beta.phlask.me
34 stars 36 forks source link

Functional Test: Mobile - Sidebar Navigation to Contact Form #492

Open gcardonag opened 4 months ago

gcardonag commented 4 months ago

Is your feature request related to a problem? Please describe. As a PHLASK developer, I would like to have automated testing of navigating to the "Contact" view in the sidebar so that this functionality works consistently throughout any future site development.

Describe the solution you'd like

  1. Add a mechanism to ensure that local tests do not send anything when the "Send Feedback" button is pressed in the Contact Form in the sidebar menu.
    1. For an example for how this is done using process.env.REACT_APP_CYPRESS_TEST, see line 37 of the src/actions.js file.
  2. Add a Cypress test that performs the following actions in cypress/e2e/mobile/menuNavigation.cy.js
    1. Click on the "Sidebar"/hamburger button on the top toolbar
    2. Click on the "Contact" option on the menu
    3. Confirm that the top header text in the sidebar shows "Contact"
    4. Fill out the form
    5. Press the "Submit Feedback" button
    6. Confirm that the panel contains the text "Thanks for your feedback!"
  3. If necessary, add data-cy attributes to resources in order to allow Cypress to target them for clicking/writing/etc.
    • For an example of how to target elements, see the the should successfully submit a water site for testing test in the cypress/e2e/desktop/crowdsourcing.cy.js file.
    • For an example of how components are updated to support the example above, see line 27 of the src/components/AddResourceModal/ChooseResource.jsx file.
  4. When opening a Pull Request for this story, make sure to include a video recording of the completed test to help reviewers.
    • When you run tests locally, a video of the test should automatically be recorded in the cypress/videos folder.

Describe alternatives you've considered N/A

Additional context Add any other context or screenshots about the feature request here.