mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
feat(mcp): update i18n locales and tests for MCP TUI
This commit is contained in:
parent
fe4ca16088
commit
c504cc0c6b
8 changed files with 144 additions and 109 deletions
|
|
@ -1251,7 +1251,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should read excludeMCPServers from settings', async () => {
|
||||
it('should read excludeMCPServers from settings but still return all servers', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const argv = await parseArguments();
|
||||
const settings: Settings = {
|
||||
|
|
@ -1259,12 +1259,18 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
|
|||
mcp: { excluded: ['server1', 'server2'] },
|
||||
};
|
||||
const config = await loadCliConfig(settings, argv, undefined, []);
|
||||
// getMcpServers() now returns all servers, use isMcpServerDisabled() to check status
|
||||
expect(config.getMcpServers()).toEqual({
|
||||
server1: { url: 'http://localhost:8080' },
|
||||
server2: { url: 'http://localhost:8081' },
|
||||
server3: { url: 'http://localhost:8082' },
|
||||
});
|
||||
expect(config.isMcpServerDisabled('server1')).toBe(true);
|
||||
expect(config.isMcpServerDisabled('server2')).toBe(true);
|
||||
expect(config.isMcpServerDisabled('server3')).toBe(false);
|
||||
});
|
||||
|
||||
it('should override allowMCPServers with excludeMCPServers if overlapping', async () => {
|
||||
it('should apply allowedMcpServers filter but excluded servers are still returned', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const argv = await parseArguments();
|
||||
const settings: Settings = {
|
||||
|
|
@ -1275,9 +1281,14 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
|
|||
},
|
||||
};
|
||||
const config = await loadCliConfig(settings, argv, undefined, []);
|
||||
// allowedMcpServers filters which servers are available
|
||||
// but excluded servers are still returned by getMcpServers()
|
||||
expect(config.getMcpServers()).toEqual({
|
||||
server1: { url: 'http://localhost:8080' },
|
||||
server2: { url: 'http://localhost:8081' },
|
||||
});
|
||||
expect(config.isMcpServerDisabled('server1')).toBe(true);
|
||||
expect(config.isMcpServerDisabled('server2')).toBe(false);
|
||||
});
|
||||
|
||||
it('should prioritize mcp server flag if set', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue