mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
test: align stale tests with merged Codex preset and bucket changes
CI on main was red because two tests did not follow intentional changes
that were already merged into the codebase:
- codexChatProviderPresets.test.ts still expected the "Kimi For Coding"
preset, which was removed in 16c3ef3f. Drop the corresponding entry
from the expected presets map.
- import_export_sync.rs still asserted the legacy per-provider
model_provider id ("rightcode"), but 9fac15b8 unified Codex
third-party providers into the stable "custom" history bucket. Mirror
the assertion update already applied to provider_service.rs.
No production code changed; both fixes only update test expectations.
This commit is contained in:
@@ -194,8 +194,8 @@ requires_openai_auth = true
|
||||
|
||||
assert_eq!(
|
||||
parsed.get("model_provider").and_then(|v| v.as_str()),
|
||||
Some("rightcode"),
|
||||
"legacy ConfigService sync should use the stable live provider id"
|
||||
Some("custom"),
|
||||
"legacy ConfigService sync should collapse third-party providers into the stable \"custom\" history bucket"
|
||||
);
|
||||
|
||||
let model_providers = parsed
|
||||
@@ -208,7 +208,7 @@ requires_openai_auth = true
|
||||
);
|
||||
assert_eq!(
|
||||
model_providers
|
||||
.get("rightcode")
|
||||
.get("custom")
|
||||
.and_then(|v| v.get("base_url"))
|
||||
.and_then(|v| v.as_str()),
|
||||
Some("https://aihubmix.example/v1")
|
||||
@@ -221,7 +221,7 @@ requires_openai_auth = true
|
||||
.and_then(|v| v.as_str())
|
||||
.expect("synced config string");
|
||||
assert!(
|
||||
synced_cfg.contains("[model_providers.rightcode]"),
|
||||
synced_cfg.contains("[model_providers.custom]"),
|
||||
"ConfigService keeps its existing behavior of syncing provider config from live"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,13 +79,6 @@ const expectedChatPresets = new Map<
|
||||
contextWindows: { "kimi-k2.6": 262144 },
|
||||
},
|
||||
],
|
||||
[
|
||||
"Kimi For Coding",
|
||||
{
|
||||
baseUrl: "https://api.kimi.com/coding/v1",
|
||||
contextWindows: { "kimi-for-coding": 262144 },
|
||||
},
|
||||
],
|
||||
[
|
||||
"StepFun",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user