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

Commit

Permalink
fix favicon and tabs UI related tests
Browse files Browse the repository at this point in the history
Auditors: @luixxiul
Fix #11135
Test Plan:
npm run test -- --grep="navigationBar tests favicon Parses favicon when one is present"
npm run test -- --grep="navigationBar tests themeColor Uses the default tab color when one is not specified"
npm run test -- --grep="tab tests tabs with icons shows tab's icon when page is not about:blank or about:newtab"
npm run test -- --grep="tab tests tabs with icons unloaded tabs should display the specified favicon"
npm run test -- --grep="tab tests webview in fullscreen mode keep favicon and title after exiting fullscreen mode"
npm run test -- --grep="returns true for regular tabs"
  • Loading branch information
cezaraugusto committed Sep 28, 2017
1 parent 013059c commit a0adb61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/renderer/components/tabs/content/favIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Favicon extends React.Component {
})

return <TabIcon
data-test-favicon={this.props.favicon}
data-test-id={this.testingIcon}
className={css(
styles.icon,
Expand Down
2 changes: 1 addition & 1 deletion test/navbar-components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ describe('navigationBar tests', function () {
const page1Url = Brave.server.url('page1.html')
yield this.app.client.tabByUrl(Brave.newTabUrl).url(page1Url).waitForUrl(page1Url).windowParentByUrl(page1Url)
let background = yield this.app.client.getCssProperty('[data-test-active-tab]', 'background')
assert.equal(background.value, 'rgb(255,255,255)nonerepeatscroll0%0%/autopadding-boxborder-box')
assert.equal(background.value, 'rgba(255,255,255,0.8)nonerepeatscroll0%0%/autopadding-boxborder-box')
})

// We need a newer electron build first
Expand Down
15 changes: 4 additions & 11 deletions test/unit/app/common/state/tabUIStateTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,15 @@ describe('tabUIState unit tests', function () {
assert.equal(tabUIState.showTabEndIcon(), false)
})

it('returns false for regular tabs', function * () {
// if there's no hover and tab is normal-sized always
// show the tab end icons
it('returns true for regular tabs', function * () {
const state = defaultState.mergeIn(['frames', index], {
isPrivate: false,
partitionNumber: 0
})
const result = tabUIState.showTabEndIcon(state, frameKey)
assert.equal(result, false)
})

it('returns false for regular tabs', function * () {
const state = defaultState.mergeIn(['frames', index], {
isPrivate: false,
partitionNumber: false
})
const result = tabUIState.showTabEndIcon(state, frameKey)
assert.equal(result, false)
assert.equal(result, true)
})

describe('when tab is partitioned', function () {
Expand Down

0 comments on commit a0adb61

Please sign in to comment.