-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03d1bc4
commit 7fb09bf
Showing
12 changed files
with
322 additions
and
125 deletions.
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
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 |
---|---|---|
|
@@ -40,6 +40,7 @@ const { | |
postTemplatesInstallHandler, | ||
getTemplatesPostInstallHandler, | ||
getPluginsHandler, | ||
getPluginDetailsHandler, | ||
postPluginsStatusHandler, | ||
postPluginsModeMiddleware, | ||
getPluginsModeHandler, | ||
|
@@ -453,7 +454,8 @@ describe('manage-prototype-handlers', () => { | |
name: pluginDisplayName.name, | ||
packageName, | ||
uninstallCommand: `npm uninstall ${packageName}`, | ||
updateCommand: `npm install ${packageName}@${latestVersion}` | ||
updateCommand: `npm install ${packageName}@${latestVersion}`, | ||
inThisPlugin: [] | ||
} | ||
|
||
beforeEach(() => { | ||
|
@@ -521,6 +523,32 @@ describe('manage-prototype-handlers', () => { | |
expect(res.redirect).toHaveBeenCalledWith(fullPath + '?search=' + search) | ||
}) | ||
|
||
describe('getPluginDetailsHandler', () => { | ||
it('plugins installed', async () => { | ||
fse.readJsonSync.mockReturnValue(undefined) | ||
req.route.path = 'plugins-installed' | ||
await getPluginDetailsHandler(req, res) | ||
expect(mockNunjucksRender).toHaveBeenCalledWith( | ||
'views/manage-prototype/plugin-details.njk', | ||
expect.objectContaining({ | ||
packageName: 'test-package', | ||
installLink: '/manage-prototype/plugins/install?package=test-package', | ||
installCommand: 'npm install test-package', | ||
updateCommand: 'npm install [email protected]', | ||
uninstallCommand: 'npm uninstall test-package', | ||
inThisPlugin: [], | ||
latestVersion: '2.0.0', | ||
latestLink: '/current-url', | ||
installedLink: '', | ||
plugin: { | ||
name: 'Test Package', | ||
version: '2.0.0' | ||
} | ||
}) | ||
) | ||
}) | ||
}) | ||
|
||
it('getPluginsModeHandler', async () => { | ||
req.params.mode = 'install' | ||
req.query.package = packageName | ||
|
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
Oops, something went wrong.