-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fixes #2453 - Changes regex to fix progressive label filtering #2496
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I think in the future we will want to restrict possible chars in labels further, but this seems good.
Can we add a functional test for this so it doesn't regress in the future? Something like:
- go to issue 100
- open the label filter widget
- type
test-label
- assert we get expected number of results
https://github.com/webcompat/webcompat.com/blob/master/tests/functional/labels-auth.js is a good place for that test.
we may need to update a fixture file or 2, that will be something to investigate if things are failing for you unexpectedly:
https://github.com/webcompat/webcompat.com/tree/master/tests/fixtures/api/issues
OK, will do. 👍 |
@miketaylr I'm not totally clear on fixtures, so I can't figure out if I'm doing something goofy or if there's something amiss in the way the fixtures are set up:
Does this sound like the fix isn't working after all, or does something need to be tweaked in the testing environment? |
OK, let's see. When looking at a normal issue (non-fixture): If i type When looking at fixture data, I get one: It seems like we're matching on the first letter after So if you search for
|
Wait, so Sorry, @miketaylr , my bad -- even setting the tests to run in non-headless, I couldn't see the labels themselves or get the inspector to run, so I just assumed everything after New commit incoming ... Edit: OK, I'm not re-running these in case you wanted to check out the error, but the tests were passing locally. Let me know if I messed up and it's not the usual problem, though. |
Travis tests have failedHey @laghee, 1st Buildnpm run test:js -- --reporters="runner" --firefoxBinary=`which firefox`
|
OK, travis is super busted, let's do this manually:
✓ firefox on darwin 17.6.0 - Labels (auth) - Label editor opens then closes (clicks)
✓ firefox on darwin 17.6.0 - Labels (auth) - Label editor opens then closes (key events)
✓ firefox on darwin 17.6.0 - Labels (auth) - Clicking outside label editor closes it
✓ firefox on darwin 17.6.0 - Labels (auth) - Clicking close button actually closes it
✓ firefox on darwin 17.6.0 - Labels (auth) - Label editor filters label list based on entered text
✓ chrome 67.0.3396.87 on Mac OS X - Labels (auth) - Label editor opens then closes (clicks)
✓ chrome 67.0.3396.87 on Mac OS X - Labels (auth) - Label editor opens then closes (key events)
✓ chrome 67.0.3396.87 on Mac OS X - Labels (auth) - Clicking outside label editor closes it
✓ chrome 67.0.3396.87 on Mac OS X - Labels (auth) - Clicking close button actually closes it
✓ chrome 67.0.3396.87 on Mac OS X - Labels (auth) - Label editor filters label list based on entered text
node
Tunnel: Ready
Total: [✓✓✓✓✓✓✓✓✓✓] 10/10
Passed: 10 Failed: 0 Skipped: 0
Fx: [✓✓✓✓✓] 5/5
Chr 67 Mac: [✓✓✓✓✓] 5/5
it started, yay! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
.type("tacos") | ||
.end() | ||
.sleep(1000) | ||
.findAllByXpath( |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This PR fixes issue
#2453
Proposed PR background
Progressive label filtering was broken, seemingly because of something wonky in the regex. I simplified the regex used in
editor.js
to escape special characters in label titles. I only included currently used special characters, so if future label titles involve anything other than/
,.
,(
,)
,/s
,-
,&
, and:
, this will need to be updated.