mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-25 05:53:00 +00:00
Group Hidden File Sync initialisation progress
This commit is contained in:
@@ -7,7 +7,11 @@ const { evalObsidianJson } = vi.hoisted(() => ({
|
||||
|
||||
vi.mock("./cli.ts", () => ({ evalObsidianJson }));
|
||||
|
||||
import { assertE2eCompatibilityMarker, type CompatibilityMarkerState } from "./liveSyncWorkflow.ts";
|
||||
import {
|
||||
assertE2eCompatibilityMarker,
|
||||
createE2eCouchDbPluginData,
|
||||
type CompatibilityMarkerState,
|
||||
} from "./liveSyncWorkflow.ts";
|
||||
|
||||
describe("compatibility marker persistence", () => {
|
||||
it("waits for an accepted review to reach device-local storage", async () => {
|
||||
@@ -32,3 +36,21 @@ describe("compatibility marker persistence", () => {
|
||||
expect(evalObsidianJson).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe("configured CouchDB fixture", () => {
|
||||
it("starts in the current remote-profile format instead of exercising legacy migration", () => {
|
||||
const pluginData = createE2eCouchDbPluginData({
|
||||
uri: "https://couch.example",
|
||||
username: "alice",
|
||||
password: "secret",
|
||||
dbName: "notes",
|
||||
});
|
||||
const remoteConfigurations = pluginData.remoteConfigurations as
|
||||
| Record<string, { id: string; uri: string }>
|
||||
| undefined;
|
||||
|
||||
expect(remoteConfigurations).toBeDefined();
|
||||
expect(Object.keys(remoteConfigurations ?? {})).toHaveLength(1);
|
||||
expect(pluginData.activeConfigurationId).toBe(Object.keys(remoteConfigurations ?? {})[0]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,8 @@ import { evalObsidianJson } from "./cli.ts";
|
||||
import { SERVICE_CONTEXT_MEMBERS } from "../../contracts/serviceContext.ts";
|
||||
import { DATABASE_COMPATIBILITY_VERSION_KEY } from "../../../src/common/databaseCompatibility.ts";
|
||||
import { CURRENT_SETTING_VERSION } from "@vrtmrz/livesync-commonlib/compat/common/models/setting.const";
|
||||
import { VER } from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import { type ObsidianLiveSyncSettings, VER } from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import { upsertRemoteConfigurationInPlace } from "@vrtmrz/livesync-commonlib/remote-configurations";
|
||||
import type { CouchDbConfig } from "./couchdb.ts";
|
||||
import type { ObjectStorageConfig } from "./objectStorage.ts";
|
||||
import { captureObsidianDialogue, withObsidianPage } from "./ui.ts";
|
||||
@@ -236,7 +237,7 @@ export function createE2eCouchDbPluginData(
|
||||
settings: Pick<CouchDbConfig, "uri" | "username" | "password"> & { dbName: string },
|
||||
overrides: Record<string, unknown> = {}
|
||||
): Record<string, unknown> {
|
||||
return {
|
||||
const pluginData = {
|
||||
couchDB_URI: settings.uri,
|
||||
couchDB_USER: settings.username,
|
||||
couchDB_PASSWORD: settings.password,
|
||||
@@ -245,6 +246,12 @@ export function createE2eCouchDbPluginData(
|
||||
...E2E_PREFERRED_SETTINGS,
|
||||
...overrides,
|
||||
};
|
||||
upsertRemoteConfigurationInPlace(pluginData as ObsidianLiveSyncSettings, "couchdb", {
|
||||
id: "e2e-couchdb",
|
||||
name: "E2E CouchDB",
|
||||
activate: true,
|
||||
});
|
||||
return pluginData;
|
||||
}
|
||||
|
||||
export function assertEqual(actual: unknown, expected: unknown, message: string): void {
|
||||
|
||||
Reference in New Issue
Block a user