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

Commit

Permalink
Merge pull request #3536 from bsclifton/fix-pw-default
Browse files Browse the repository at this point in the history
Update getActivePasswordManager call to call getSettings
  • Loading branch information
bbondy authored Aug 30, 2016
2 parents 7f1d28c + 4fea046 commit 93a7ee9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports.getSetting = (settingKey, settingsCollection) => {
}

module.exports.getActivePasswordManager = (settingsCollection) => {
const passwordManager = resolveValue(settings.ACTIVE_PASSWORD_MANAGER, settingsCollection)
const passwordManager = module.exports.getSetting(settings.ACTIVE_PASSWORD_MANAGER, settingsCollection)

let details = {
name: passwordManager,
Expand Down
11 changes: 11 additions & 0 deletions test/unit/settingsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,16 @@ describe('settings unit test', function () {
const actualResult = settings.getActivePasswordManager(settingsCollection)
assert.deepEqual(actualResult, expectedResult)
})

it('calls getSetting to get the value (providing a default if none exists)', function () {
settingsCollection[settingsConst.ONE_PASSWORD_ENABLED] = true
const expectedResult = Immutable.fromJS({
name: passwordManagers.ONE_PASSWORD,
extensionId: extensionIds[passwordManagers.ONE_PASSWORD],
displayName: displayNames[passwordManagers.ONE_PASSWORD]
})
const actualResult = settings.getActivePasswordManager(settingsCollection)
assert.deepEqual(actualResult, expectedResult)
})
})
})

0 comments on commit 93a7ee9

Please sign in to comment.