feat(FN-2982): merge fusion/fn-2982
Merges FN-2982 Step 3: adds model filtering for the droid-cli settings API, fixes planning mode question display and new-session reset in the dashboard, and adds test coverage for droid-cli settings and model route registration. Fusion-Task-Id: FN-2982
This commit is contained in:
@@ -779,7 +779,7 @@ describe("Migration: pre-33 DB upgrade", () => {
|
||||
// Step 1: Create a fresh database at v33 (runs all migrations up to 33)
|
||||
const db1 = createDatabase(legacyDir);
|
||||
db1.init();
|
||||
expect(db1.getSchemaVersion()).toBe(56);
|
||||
expect(db1.getSchemaVersion()).toBe(57);
|
||||
db1.close();
|
||||
|
||||
// Step 2: Manually downgrade to version 32 and drop insight tables
|
||||
@@ -814,7 +814,7 @@ describe("Migration: pre-33 DB upgrade", () => {
|
||||
expect(tableNamesBefore).not.toContain("project_insight_runs");
|
||||
// Now run init — this triggers the v32→v33 migration
|
||||
db3.init();
|
||||
expect(db3.getSchemaVersion()).toBe(56);
|
||||
expect(db3.getSchemaVersion()).toBe(57);
|
||||
|
||||
// Step 4: Verify insight tables exist after migration
|
||||
const tablesAfter = db3.prepare(
|
||||
@@ -845,12 +845,12 @@ describe("Migration: pre-33 DB upgrade", () => {
|
||||
try {
|
||||
const db1 = createDatabase(testDir);
|
||||
db1.init();
|
||||
expect(db1.getSchemaVersion()).toBe(56);
|
||||
expect(db1.getSchemaVersion()).toBe(57);
|
||||
db1.close();
|
||||
|
||||
const db2 = createDatabase(testDir);
|
||||
expect(() => db2.init()).not.toThrow();
|
||||
expect(db2.getSchemaVersion()).toBe(56);
|
||||
expect(db2.getSchemaVersion()).toBe(57);
|
||||
db2.close();
|
||||
} finally {
|
||||
rmSync(testDir, { recursive: true, force: true });
|
||||
|
||||
@@ -2629,7 +2629,7 @@ describe("MissionStore", () => {
|
||||
|
||||
describe("Loop State & Validator Run Schema (v31)", () => {
|
||||
it("schema version is 40 after migration", () => {
|
||||
expect(db.getSchemaVersion()).toBe(56);
|
||||
expect(db.getSchemaVersion()).toBe(57);
|
||||
});
|
||||
|
||||
it("mission_features table has loop state columns", () => {
|
||||
|
||||
@@ -742,7 +742,7 @@ describe("RoadmapStore", () => {
|
||||
|
||||
describe("schema version", () => {
|
||||
it("schema version is 40 after init", () => {
|
||||
expect(db.getSchemaVersion()).toBe(56);
|
||||
expect(db.getSchemaVersion()).toBe(57);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ describe("Run Audit", () => {
|
||||
});
|
||||
|
||||
it("schema version is bumped to 40", () => {
|
||||
expect(db.getSchemaVersion()).toBe(56);
|
||||
expect(db.getSchemaVersion()).toBe(57);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("TaskStore task documents", () => {
|
||||
|
||||
expect(tableNames.has("task_documents")).toBe(true);
|
||||
expect(tableNames.has("task_document_revisions")).toBe(true);
|
||||
expect(db.getSchemaVersion()).toBe(56);
|
||||
expect(db.getSchemaVersion()).toBe(57);
|
||||
|
||||
const index = db
|
||||
.prepare(
|
||||
|
||||
28
packages/core/src/__tests__/use-droid-cli-settings.test.ts
Normal file
28
packages/core/src/__tests__/use-droid-cli-settings.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { GlobalSettings } from "../types.js";
|
||||
import {
|
||||
DEFAULT_GLOBAL_SETTINGS,
|
||||
GLOBAL_SETTINGS_KEYS,
|
||||
isGlobalSettingsKey,
|
||||
} from "../settings-schema.js";
|
||||
|
||||
describe("useDroidCli global setting", () => {
|
||||
it("is included in GLOBAL_SETTINGS_KEYS", () => {
|
||||
expect(GLOBAL_SETTINGS_KEYS).toContain("useDroidCli");
|
||||
});
|
||||
|
||||
it("defaults to undefined", () => {
|
||||
expect(DEFAULT_GLOBAL_SETTINGS.useDroidCli).toBeUndefined();
|
||||
});
|
||||
|
||||
it("is recognized by isGlobalSettingsKey", () => {
|
||||
expect(isGlobalSettingsKey("useDroidCli")).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts boolean values in GlobalSettings", () => {
|
||||
const enabled: GlobalSettings = { useDroidCli: true };
|
||||
const disabled: GlobalSettings = { useDroidCli: false };
|
||||
expect(enabled.useDroidCli).toBe(true);
|
||||
expect(disabled.useDroidCli).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user