Skip to content

Commit

Permalink
Fix unit tests which were unintentionally broke with recent changes
Browse files Browse the repository at this point in the history
- site utils test breaking caused with brave#7207. Was always adding location, even when not present (which is the case for folders)
- preferences needed SVG stub after adding new icon with brave#7157

Auditors: @darkdh, @cezaraugusto

Test Plan:
npm run unittest
  • Loading branch information
bsclifton committed Feb 15, 2017
1 parent 938b2d2 commit 340b98e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/state/siteUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ module.exports.addSite = function (sites, siteDetail, tag, originalSiteDetail, s
sites = sites.delete(oldKey)
}

site = site.set('location', UrlUtil.getLocationIfPDF(site.get('location')))
if (site.has('location')) {
site = site.set('location', UrlUtil.getLocationIfPDF(site.get('location')))
}

const key = module.exports.getSiteKey(site)
if (key === null) {
Expand Down
1 change: 1 addition & 0 deletions test/unit/about/preferencesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('Preferences component', function () {
mockery.registerMock('../../less/button.less', {})
mockery.registerMock('../../node_modules/font-awesome/css/font-awesome.css', {})
mockery.registerMock('../../extensions/brave/img/caret_down_grey.svg', 'caret_down_grey.svg')
mockery.registerMock('../../app/extensions/brave/img/preferences/browser_prefs_plugins.svg', 'browser_prefs_plugins.svg')
window.chrome = fakeElectron
window.CustomEvent = {}

Expand Down

0 comments on commit 340b98e

Please sign in to comment.