Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
fix urlbar hover/typing test
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver authored and bsclifton committed May 10, 2017
1 parent d4ae5a8 commit 825af58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ class UrlBar extends React.Component {
onChange (e) {
if (e.target.value !== this.lastVal + this.lastSuffix) {
e.preventDefault()
// clear any current arrow or mouse hover selection
windowActions.setUrlBarSuggestions(undefined, null)
this.setValue(e.target.value)
}
}
Expand Down Expand Up @@ -301,6 +303,8 @@ class UrlBar extends React.Component {
if (this.props.isSelected) {
windowActions.setUrlBarSelected(false)
}
// clear any current arrow or mouse hover selection
windowActions.setUrlBarSuggestions(undefined, null)
this.keyPressed = false
windowActions.setNavBarUserInput(this.lastVal)
}
Expand Down
6 changes: 3 additions & 3 deletions test/navbar-components/urlBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('urlBar tests', function () {
})

describe('with scrolling match', function () {
it('does not show suggestions on focus', function * () {
it('typing in the urlbar should override mouse hover for suggestions', function * () {
yield this.app.client
.addSite({ location: 'https://brave.com/test2' })
.addSite({ location: 'https://brave.com/test3' })
Expand All @@ -135,9 +135,9 @@ describe('urlBar tests', function () {
.resizeWindow(500, 300)
.setValue(urlInput, 'b')
.waitForVisible(urlBarSuggestions)
.moveToObject(urlBarSuggestions, 0, 50)
// highlight for autocomplete brianbondy.com
.moveToObject(urlBarSuggestions, 0, 100)
.moveToObject(urlBarSuggestions, 0, 150)
yield selectsText(this.app.client, 'rianbondy.com')
.keys('ra')
.execute(function (urlBarSuggestions) {
document.querySelector(urlBarSuggestions).scrollTop = 200
Expand Down

0 comments on commit 825af58

Please sign in to comment.