mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* Initial plan * Add Open in Desktop option to document menu Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * Tweak naming --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { sharedModelPath, desktopify } from "./routeHelpers";
|
|
|
|
describe("#sharedDocumentPath", () => {
|
|
test("should return share path for a document", () => {
|
|
const shareId = "1c922644-40d8-41fe-98f9-df2b67239d45";
|
|
const docPath = "/doc/test-DjDlkBi77t";
|
|
expect(sharedModelPath(shareId)).toBe(
|
|
"/s/1c922644-40d8-41fe-98f9-df2b67239d45"
|
|
);
|
|
expect(sharedModelPath(shareId, docPath)).toBe(
|
|
"/s/1c922644-40d8-41fe-98f9-df2b67239d45/doc/test-DjDlkBi77t"
|
|
);
|
|
});
|
|
});
|
|
|
|
describe("#desktopify", () => {
|
|
test("should replace https protocol with outline://", () => {
|
|
Object.defineProperty(window, "location", {
|
|
value: { origin: "https://app.getoutline.com" },
|
|
writable: true,
|
|
});
|
|
expect(desktopify("/doc/test-DjDlkBi77t")).toBe(
|
|
"outline://app.getoutline.com/doc/test-DjDlkBi77t"
|
|
);
|
|
});
|
|
|
|
test("should replace http protocol with outline://", () => {
|
|
Object.defineProperty(window, "location", {
|
|
value: { origin: "http://localhost:3000" },
|
|
writable: true,
|
|
});
|
|
expect(desktopify("/doc/test-DjDlkBi77t")).toBe(
|
|
"outline://localhost:3000/doc/test-DjDlkBi77t"
|
|
);
|
|
});
|
|
});
|