Add I Ching MCP to extension catalog (#4525)
This commit is contained in:
@@ -94,6 +94,23 @@ describe('ExtensionInstallModal', () => {
|
||||
expect(screen.getAllByRole('button')).toHaveLength(3);
|
||||
});
|
||||
|
||||
|
||||
it("should handle i-ching-mcp-server as allowed command", async () => {
|
||||
mockElectron.getAllowedExtensions.mockResolvedValue([]);
|
||||
|
||||
render(<ExtensionInstallModal addExtension={mockAddExtension} />);
|
||||
|
||||
const eventHandler = getAddExtensionEventHandler();
|
||||
|
||||
await act(async () => {
|
||||
await eventHandler({}, "goose://extension?cmd=i-ching-mcp-server&id=i-ching&name=I%20Ching&description=I%20Ching%20divination");
|
||||
});
|
||||
|
||||
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
||||
expect(screen.getByText("Confirm Extension Installation")).toBeInTheDocument();
|
||||
expect(screen.getByText(/I Ching extension/)).toBeInTheDocument();
|
||||
expect(screen.getAllByRole("button")).toHaveLength(3);
|
||||
});
|
||||
it('should handle blocked extension', async () => {
|
||||
mockElectron.getAllowedExtensions.mockResolvedValue(['uvx allowed-package']);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function getStdioConfig(
|
||||
timeout: number
|
||||
) {
|
||||
// Validate that the command is one of the allowed commands
|
||||
const allowedCommands = ['cu', 'docker', 'jbang', 'npx', 'uvx', 'goosed', 'npx.cmd'];
|
||||
const allowedCommands = ['cu', 'docker', 'jbang', 'npx', 'uvx', 'goosed', 'npx.cmd', 'i-ching-mcp-server'];
|
||||
if (!allowedCommands.includes(cmd)) {
|
||||
toastService.handleError(
|
||||
'Invalid Command',
|
||||
|
||||
Reference in New Issue
Block a user