fix: improve the behavior for the web app

This commit is contained in:
2026-07-11 20:30:05 +07:00
parent 71b0bfb6d8
commit 8d731d84fb
8 changed files with 252 additions and 81 deletions
+14
View File
@@ -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();