-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Two apps with same name, but different paths now will be displayed * Update cerebro-tools
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import appsInjector from 'inject!../../../app/main/plugins/core/apps' | ||
import assert from 'assert' | ||
import uniq from 'lodash/uniq' | ||
|
||
let appsList = [ | ||
{ | ||
name: 'App Store', | ||
filename: 'App Store.app', | ||
path: '/Applications/App Store.app' | ||
}, | ||
{ | ||
name: 'App Store', | ||
filename: 'App Store.prefPane', | ||
path: '/System/Library/PreferencePanes/AppStore.prefPane' | ||
} | ||
] | ||
const getAppsList = () => Promise.resolve(appsList) | ||
|
||
const apps = appsInjector({ | ||
'./lib/getAppsList': getAppsList, | ||
'react': () => {}, | ||
'./Preview': () => {}, | ||
}) | ||
|
||
describe('OSx apps plugin', () => { | ||
it('shows two apps with the same name but different paths', (done) => { | ||
const term = 'App' | ||
const display = (results) => { | ||
const ids = results.map(file => file.id || file.title) | ||
assert(uniq(ids).length === 2) | ||
done() | ||
} | ||
apps.fn({ term, display }) | ||
}) | ||
}) |