mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix: improve the behavior for the web app
This commit is contained in:
@@ -352,6 +352,20 @@ describe("DB SQLite layer — public API parity", () => {
|
||||
expect((await sqliteDb.getModelAliases()).marker).toBe("before");
|
||||
});
|
||||
|
||||
it("exportDb / importDb preserves disabled model settings", async () => {
|
||||
await sqliteDb.disableModels("backup-provider", ["backup-model"]);
|
||||
const snapshot = await sqliteDb.exportDb();
|
||||
|
||||
expect(snapshot.disabledModels).toMatchObject({
|
||||
"backup-provider": ["backup-model"],
|
||||
});
|
||||
|
||||
await sqliteDb.enableModels("backup-provider", []);
|
||||
await sqliteDb.importDb(snapshot);
|
||||
|
||||
expect(await sqliteDb.getDisabledByProvider("backup-provider")).toEqual(["backup-model"]);
|
||||
});
|
||||
|
||||
it("pricing: user pricing merged with constants", async () => {
|
||||
await sqliteDb.updatePricing({ openai: { "gpt-test": { input: 1, output: 2 } } });
|
||||
const p = await sqliteDb.getPricing();
|
||||
|
||||
Reference in New Issue
Block a user