mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
fix test:ci
This commit is contained in:
@@ -98,6 +98,7 @@ describe('Settings Loading and Merging', () => {
|
||||
expect(settings.merged).toEqual({
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
expect(settings.errors.length).toBe(0);
|
||||
});
|
||||
@@ -131,6 +132,7 @@ describe('Settings Loading and Merging', () => {
|
||||
...systemSettingsContent,
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -164,6 +166,7 @@ describe('Settings Loading and Merging', () => {
|
||||
...userSettingsContent,
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -195,6 +198,7 @@ describe('Settings Loading and Merging', () => {
|
||||
...workspaceSettingsContent,
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -232,6 +236,7 @@ describe('Settings Loading and Merging', () => {
|
||||
contextFileName: 'WORKSPACE_CONTEXT.md',
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -281,6 +286,7 @@ describe('Settings Loading and Merging', () => {
|
||||
allowMCPServers: ['server1', 'server2'],
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -560,6 +566,7 @@ describe('Settings Loading and Merging', () => {
|
||||
expect(settings.merged).toEqual({
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
|
||||
// Check that error objects are populated in settings.errors
|
||||
@@ -954,6 +961,7 @@ describe('Settings Loading and Merging', () => {
|
||||
...systemSettingsContent,
|
||||
customThemes: {},
|
||||
mcpServers: {},
|
||||
openaiConfig: {},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ export function AuthDialog({
|
||||
if (model.trim()) openAIConfig.OPENAI_MODEL = model.trim();
|
||||
|
||||
// Save to user settings as environment variables for next time
|
||||
settings.setValue(SettingScope.User, 'openaiConfig' as any, openAIConfig);
|
||||
settings.setValue(SettingScope.User, 'openaiConfig', openAIConfig);
|
||||
} catch (error) {
|
||||
// Don't block authentication if saving fails
|
||||
console.warn('Failed to save OpenAI config to settings:', error);
|
||||
@@ -142,9 +142,18 @@ export function AuthDialog({
|
||||
if (showOpenAIKeyPrompt) {
|
||||
// Load default values from settings
|
||||
const defaultValues = {
|
||||
apiKey: process.env.OPENAI_API_KEY || settings.merged.openaiConfig?.OPENAI_API_KEY || '',
|
||||
baseUrl: process.env.OPENAI_BASE_URL || settings.merged.openaiConfig?.OPENAI_BASE_URL || '',
|
||||
model: process.env.OPENAI_MODEL || settings.merged.openaiConfig?.OPENAI_MODEL || '',
|
||||
apiKey:
|
||||
process.env.OPENAI_API_KEY ||
|
||||
settings.merged.openaiConfig?.OPENAI_API_KEY ||
|
||||
'',
|
||||
baseUrl:
|
||||
process.env.OPENAI_BASE_URL ||
|
||||
settings.merged.openaiConfig?.OPENAI_BASE_URL ||
|
||||
'',
|
||||
model:
|
||||
process.env.OPENAI_MODEL ||
|
||||
settings.merged.openaiConfig?.OPENAI_MODEL ||
|
||||
'',
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -189,7 +198,7 @@ export function AuthDialog({
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={Colors.AccentBlue}>
|
||||
{'https://github.com/QwenLM/Qwen3-Coder/blob/main/README.md'}
|
||||
{'https://github.com/QwenLM/qwen-code/blob/main/README.md'}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -17,8 +17,7 @@ describe('OpenAIKeyPrompt', () => {
|
||||
<OpenAIKeyPrompt onSubmit={onSubmit} onCancel={onCancel} />,
|
||||
);
|
||||
|
||||
expect(lastFrame()).toContain('OpenAI Configuration Required');
|
||||
expect(lastFrame()).toContain('https://platform.openai.com/api-keys');
|
||||
expect(lastFrame()).toContain('API Configuration Required');
|
||||
expect(lastFrame()).toContain(
|
||||
'Press Enter to continue, Tab/↑↓ to navigate, Esc to cancel',
|
||||
);
|
||||
@@ -33,7 +32,7 @@ describe('OpenAIKeyPrompt', () => {
|
||||
);
|
||||
|
||||
const output = lastFrame();
|
||||
expect(output).toContain('OpenAI Configuration Required');
|
||||
expect(output).toContain('API Configuration Required');
|
||||
expect(output).toContain('API Key:');
|
||||
expect(output).toContain('Base URL:');
|
||||
expect(output).toContain('Model:');
|
||||
|
||||
@@ -31,7 +31,6 @@ export function OpenAIKeyPrompt({
|
||||
>('apiKey');
|
||||
|
||||
useInput((input, key) => {
|
||||
|
||||
// Ignore control sequences like [I or [O from focus switching
|
||||
if (input && (input === '[I' || input === '[O')) {
|
||||
return;
|
||||
@@ -147,15 +146,10 @@ export function OpenAIKeyPrompt({
|
||||
width="100%"
|
||||
>
|
||||
<Text bold color={Colors.AccentBlue}>
|
||||
OpenAI Configuration Required
|
||||
API Configuration Required
|
||||
</Text>
|
||||
<Box marginTop={1}>
|
||||
<Text>
|
||||
Please enter your OpenAI configuration. You can get an API key from{' '}
|
||||
<Text color={Colors.AccentBlue}>
|
||||
https://platform.openai.com/api-keys
|
||||
</Text>
|
||||
</Text>
|
||||
<Text>Please enter your API configuration.</Text>
|
||||
</Box>
|
||||
<Box marginTop={1} flexDirection="row">
|
||||
<Box width={12}>
|
||||
|
||||
Reference in New Issue
Block a user