mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-26 06:22:58 +00:00
Test Security Seed refresh in Real Obsidian
This commit is contained in:
@@ -10,6 +10,7 @@ vi.mock("./cli.ts", () => ({ evalObsidianJson }));
|
||||
import {
|
||||
assertE2eCompatibilityMarker,
|
||||
createE2eCouchDbPluginData,
|
||||
waitForLiveSyncCoreReady,
|
||||
type CompatibilityMarkerState,
|
||||
} from "./liveSyncWorkflow.ts";
|
||||
|
||||
@@ -54,3 +55,25 @@ describe("configured CouchDB fixture", () => {
|
||||
expect(pluginData.activeConfigurationId).toBe(Object.keys(remoteConfigurations ?? {})[0]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Real Obsidian core readiness", () => {
|
||||
it("retries while the plug-in core is temporarily unavailable during reload", async () => {
|
||||
evalObsidianJson.mockReset();
|
||||
evalObsidianJson
|
||||
.mockRejectedValueOnce(new Error("Cannot read properties of undefined (reading 'core')"))
|
||||
.mockResolvedValueOnce({
|
||||
databaseReady: true,
|
||||
appReady: true,
|
||||
configured: true,
|
||||
remoteType: "",
|
||||
settingVersion: 10,
|
||||
suspended: false,
|
||||
});
|
||||
|
||||
await expect(waitForLiveSyncCoreReady("obsidian-cli", {}, 1000)).resolves.toMatchObject({
|
||||
databaseReady: true,
|
||||
appReady: true,
|
||||
});
|
||||
expect(evalObsidianJson).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user