mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-11-27 06:32:42 +00:00
Prefer physical table ownership for wrapped embeds and reset relative mobile toolbar offsets. Add independent ribbon and empty-tab action preferences using the canonical creation/settings pipelines, with maintained translations and deterministic cleanup. Toggle pen to selection on a second unmodified P at the plugin capture boundary. Cancel incomplete Extras APIs cleanly while preserving version gates; the incomplete #3051 reporter cause remains unconfirmed. Pair native video coverage with fork PR #484's two-condition iframe fix. Validation: 781 plugin source cases, five bundle checks, development/production builds, focused lint, CSS and inventory pass. Fork source/browser/type/audit evidence and inherited-test limitations are documented. Native CLI testing is explicitly paused at maintainer request. Versions and dependencies remain unchanged. Refs #3049, #3047, #3044, #3048 and #3051.
30 lines
1.6 KiB
JavaScript
30 lines
1.6 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { sourceHarness } from "./sourceHarness.mjs";
|
|
|
|
test("an enabled Extras plugin with an absent or incomplete API cancels service access cleanly", async () => {
|
|
const notices = [], graph = sourceHarness({
|
|
obsidian: { Modal: class {
|
|
contentEl = { empty() {} };
|
|
open() { this.onOpen(); } close() { this.onClose(); }
|
|
}, Notice: class { constructor(text) { notices.push(text); } }, Setting: class {} },
|
|
"../lang/helpers": { t: key => key }, "src/lang/locale/en": { default: {} },
|
|
});
|
|
try {
|
|
const { ExcalidrawExtrasGateway } = await graph.importModule("src/utils/ExcalidrawExtrasGateway.ts");
|
|
for (const api of [undefined, {}, { versions: {} }, { features: {}, versions: {} }, { versions: {}, features: { isActive() { return true; } } }]) {
|
|
const gateway = new ExcalidrawExtrasGateway({ plugins: {
|
|
manifests: { "excalidraw-extras": { version: "0.1.2" } }, plugins: { "excalidraw-extras": { api } },
|
|
} }, {});
|
|
assert.equal(await gateway.getMermaid(), null);
|
|
}
|
|
assert.equal(notices.length, 5);
|
|
assert.ok(notices.every(text => text === "EXTRAS_GATEWAY_API_MISSING"));
|
|
const gateway = new ExcalidrawExtrasGateway({ plugins: { manifests: { "excalidraw-extras": { version: "0.2.1" } } } }, {});
|
|
for (const versions of [undefined, {}, { mathjax: undefined }, { mathjax: 1 }]) {
|
|
const result = gateway.checkVersion("mathjax", { versions });
|
|
assert.equal(result.valid, false); assert.equal(result.currentVersion, "0.0.0");
|
|
}
|
|
} finally { graph.close(); }
|
|
});
|