carbon icon indicating copy to clipboard operation
carbon copied to clipboard

fix(ModalWrapper): fix submit and close logic, add story w/ args, update tests to RTL

Open jnm2377 opened this issue 1 year ago • 2 comments

Closes #11713

Changelog

While I was working on refactoring the tests to RTL, I added a story to check everything, then I realized some of the functionalities were actually not working. Specifically closing (on secondary click and close button click) and close on submit. It would, however, close on esc.

  • updates tests to RTL
  • one snapshot automatically deleted when tests were updated
  • adds story
  • fix this.modal.current.innerModal.current was returning undefined (probably bc Modal is now a wrapper)
  • fix handleSubmit to actually close on submit if the prop is true

Testing / Reviewing

  • test against website to view bug: https://carbondesignsystem.com/components/modal/code/
  • test story and check that:
    • modal opens correctly on click
    • modal opens correctly on button enter
    • modal closes on esc press
    • modal closes on Cancel or close button click
    • modal closes on Cancel or close button enter
    • modal closes on submit click
    • modal closes on submit enter
    • modal does not close on inner modal click
    • modal closes on outer modal click
  • check that all tests are passing and make sense

jnm2377 avatar Jul 21 '22 15:07 jnm2377

Deploy Preview for carbon-components-react ready!

Name Link
Latest commit 68b6a1470f053127656f46bccd4deb985f0533b9
Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/62f56c5c7f05c1000990de53
Deploy Preview https://deploy-preview-11839--carbon-components-react.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jul 21 '22 15:07 netlify[bot]

Deploy Preview for carbon-elements ready!

Name Link
Latest commit 68b6a1470f053127656f46bccd4deb985f0533b9
Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/62f56c5cd9e413000712eac8
Deploy Preview https://deploy-preview-11839--carbon-elements.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jul 21 '22 15:07 netlify[bot]