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

Commit

Permalink
Don't show-up siteInfo modal for url searches
Browse files Browse the repository at this point in the history
Auditors: @diracdeltas
Close #9172
Test Plan:
covered by automated tests
  • Loading branch information
cezaraugusto committed Jun 10, 2017
1 parent 902ee0d commit fb7d21c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/renderer/components/main/siteInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class SiteInfo extends ImmutableComponent {
</div>
}

return <Dialog onHide={this.props.onHide} className='siteInfo' isClickDismiss>
return <Dialog testId='siteInfoDialog' onHide={this.props.onHide} className='siteInfo' isClickDismiss>
<div onClick={(e) => e.stopPropagation()}
className={cx({
[css(commonStyles.flyoutDialog)]: true,
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/urlBarIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class UrlBarIcon extends ImmutableComponent {
}
}
onClick () {
if (isSourceAboutUrl(this.props.location)) {
if (isSourceAboutUrl(this.props.location) || this.isSearch) {
return
}
windowActions.setSiteInfoVisible(true)
Expand Down
6 changes: 4 additions & 2 deletions test/lib/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
tabPage1: '[data-tab-page="0"]',
tabPage2: '[data-tab-page="1"]',
closeTab: '[data-test-id="closeTabIcon"]',
urlbarIcon: '.urlbarIcon',
urlbarIcon: '[data-test-id="urlBarIcon"]',
urlBarSuggestions: '.urlBarSuggestions',
titleBar: '#titleBar',
navigatorBookmarked: '#navigator .removeBookmarkButton',
Expand Down Expand Up @@ -125,5 +125,7 @@ module.exports = {
downloadReDownload: '[data-test-id="redownloadButton"]',
downloadDelete: '[data-test-id="deleteButton"]',
downloadDeleteConfirm: '[data-test-id="confirmDeleteButton"]',
downloadRemoveFromList: '[data-test-id="downloadRemoveFromList"]'
downloadRemoveFromList: '[data-test-id="downloadRemoveFromList"]',

siteInfoDialog: '[data-test-id="siteInfoDialog"]'
}
19 changes: 19 additions & 0 deletions test/unit/app/renderer/components/navigation/urlBarIconTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ describe('UrlBarIcon component unit tests', function () {
windowActions.setSiteInfoVisible.restore()
})

describe('when user is searching', function () {
const props2 = Object.assign({}, props)

before(function () {
props2.isSearching = true
props2.titleMode = false
})

it('does not show site information when clicked', function () {
const spy = sinon.spy(windowActions, 'setSiteInfoVisible')
const wrapper = mount(
<UrlBarIcon {...props2} />
)
wrapper.find('[data-test-id="urlBarIcon"]').simulate('click')
assert.equal(spy.notCalled, true)
windowActions.setSiteInfoVisible.restore()
})
})

describe('when active tab is showing a message box', function () {
const props2 = Object.assign({}, props)

Expand Down

0 comments on commit fb7d21c

Please sign in to comment.