Files
outline/app/utils/routeHelpers.test.ts
Tom Moor c6aacfeeeb chore: Clear minimatch ReDoS advisories from audit ignore list (#12177)
* 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>
2026-04-27 09:13:52 -04:00

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"
);
});
});