Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use keyboard shortcut hook in listing modal #11017

Merged
merged 1 commit into from Oct 22, 2020

Conversation

reobin
Copy link
Contributor

@reobin reobin commented Oct 22, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Use the new keyboard shortcut hook to listen for Escape keypress to close an open listing modal

Related Tickets & Documents

#10878

QA Instructions, Screenshots, Recordings

  1. Go to listings
  2. Open a listing
  3. Press Escape
  4. Verify that the listing modal closes

Added tests?

  • yes
  • no, because they aren't needed
  • no, because I need help

I'd like to add tests for this, but the <Listings /> component does not currently have tests.

It seems to need a lot of stuff in order to set it up (mocking, adding divs to the DOM, etc.).

Any help with that is appreciated.

Closing the modal is probably not the most crucial test to do in this component, but if making the set up opens the door to more tests, then it's a win.

Added to documentation?

  • docs.forem.com
  • readme
  • no documentation needed

What gif best describes this PR or how it makes you feel?

spooky

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 22, 2020
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thanks @reobin!

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 22, 2020
@benhalpern benhalpern merged commit 3c586d7 into forem:master Oct 22, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants