mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
c6aacfeeeb
* chore: Resolve minimatch ReDoS advisories via dep bumps and resolutions Bump glob (8→11), rimraf (2→6), babel-jest, jest-environment-jsdom (29→30), and lint-staged (13→16) to drop several vulnerable transitive chains. Pin remaining minimatch and brace-expansion descriptors via resolutions so all in-tree copies are on their latest patched release. Removes 9 ignored advisory IDs from .yarnrc.yml. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: Make routeHelpers.urlify origin testable for jsdom 26 jsdom 26 (jest-environment-jsdom@30) makes window.location and location.origin non-configurable, breaking the previous test that redefined them via Object.defineProperty. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: Align jest-cli to ^30.3.0 with other jest packages Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
29 lines
956 B
TypeScript
29 lines
956 B
TypeScript
import { sharedModelPath, desktopify } from "./routeHelpers";
|
|
|
|
describe("#sharedDocumentPath", () => {
|
|
it("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", () => {
|
|
it("should replace https protocol with outline://", () => {
|
|
expect(
|
|
desktopify("/doc/test-DjDlkBi77t", "https://app.getoutline.com")
|
|
).toBe("outline://app.getoutline.com/doc/test-DjDlkBi77t");
|
|
});
|
|
|
|
it("should replace http protocol with outline://", () => {
|
|
expect(desktopify("/doc/test-DjDlkBi77t", "http://localhost:3000")).toBe(
|
|
"outline://localhost:3000/doc/test-DjDlkBi77t"
|
|
);
|
|
});
|
|
});
|