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

Commit

Permalink
Fix unittest errors
Browse files Browse the repository at this point in the history
Addresses #8735

Test Plan: npm run unittest
  • Loading branch information
Suguru Hirahara committed Jul 4, 2017
1 parent f85e4b1 commit 01ff951
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class UrlBar extends React.Component {

// BEM Level: urlbarForm__titleBar
get titleBar () {
return <div id='titleBar' className={css(styles.titleBar)}>
return <div id='titleBar' data-test-id='titleBar' className={css(styles.titleBar)}>
<span className={css(styles.titleBar__host)}>{this.props.hostValue}</span>
<span>{this.props.hostValue && this.titleValue ? ' | ' : ''}</span>
<span>{this.titleValue}</span>
Expand Down
2 changes: 1 addition & 1 deletion test/lib/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
closeTab: '[data-test-id="closeTabIcon"]',
urlBarIcon: '[data-test-id="urlBarIcon"]',
urlBarSuggestions: '.urlBarSuggestions',
titleBar: '#titleBar',
titleBar: '[data-test-id="titleBar"]',
navigatorBookmarked: '[data-test-id="bookmarked"]',
navigatorNotBookmarked: '[data-test-id="notBookmarked"]',
bookmarksToolbar: '[data-test-id="bookmarksToolbar"]',
Expand Down
11 changes: 11 additions & 0 deletions test/unit/app/renderer/components/navigation/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ describe('NavigationBar component', function () {
mockery.registerMock('../../../extensions/brave/img/urlbar/browser_URL_fund_no.svg')
mockery.registerMock('../../../extensions/brave/img/urlbar/browser_URL_fund_yes.svg')
mockery.registerMock('../../../extensions/brave/img/caret_down_grey.svg')
mockery.registerMock('../../../../../img/toolbar/stoploading_btn.svg')
mockery.registerMock('../../../../../img/toolbar/reload_btn.svg')
mockery.registerMock('../../../../../img/toolbar/home_btn.svg')
mockery.registerMock('../../../../../img/toolbar/bookmark_btn.svg')
mockery.registerMock('../../../../../img/toolbar/bookmark_marked.svg')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn.png')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn2x.png')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn3x.png')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn_hover.png')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn2x_hover.png')
mockery.registerMock('../../../../app/extensions/brave/img/braveBtn3x_hover.png')
mockery.registerMock('./urlBar', urlBarFake)
windowStore = require('../../../../../../js/stores/windowStore')
appStore = require('../../../../../../js/stores/appStoreRenderer')
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/renderer/components/navigation/navigatorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('Navigator component unit tests', function () {
})

it('disables the lion icon', function () {
const node = wrapper.find('[data-test-id="braveShieldButton"]').getDOMNode()
const node = wrapper.find('[data-test-id="braveMenu"]').getDOMNode()
assert.equal(node.disabled, true)
})
})
Expand All @@ -171,7 +171,7 @@ describe('Navigator component unit tests', function () {

it('lion icon is shown by default', function () {
const wrapper = mount(<Navigator />)
const node = wrapper.find('[data-test-id="braveShieldButton"]').getDOMNode()
const node = wrapper.find('[data-test-id="braveMenu"]').getDOMNode()
assert.equal(node.disabled, false)
})

Expand Down

0 comments on commit 01ff951

Please sign in to comment.