mirror of
https://github.com/outline/outline.git
synced 2026-01-06 11:09:55 -06:00
feat: collection mentions (#8529)
* feat: init collection mention * refactor: dedicated search helper function for collection mentions * feat: add test for collection search function helper * feat: parseCollectionSlug * feat: isCollectionUrl * feat: add collection mention to paste handler * fix: update translation of mention keyboard shortcut * fix: keyboard shortcut mention label * fix: missing teamId in search helper functioN * chore: update translations --------- Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
48
shared/utils/parseCollectionSlug.test.ts
Normal file
48
shared/utils/parseCollectionSlug.test.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import sharedEnv from "../env";
|
||||
import parseCollectionSlug from "./parseCollectionSlug";
|
||||
|
||||
sharedEnv.URL = "https://app.outline.dev";
|
||||
|
||||
describe("#parseCollectionSlug", () => {
|
||||
it("should work with fully qualified url", () => {
|
||||
expect(
|
||||
parseCollectionSlug("http://example.com/collection/test-ANzZwgv2RG")
|
||||
).toEqual("test-ANzZwgv2RG");
|
||||
});
|
||||
|
||||
it("should work with paths after document slug", () => {
|
||||
expect(
|
||||
parseCollectionSlug(
|
||||
"http://mywiki.getoutline.com/collection/test-ANzZwgv2RG/recent"
|
||||
)
|
||||
).toEqual("test-ANzZwgv2RG");
|
||||
});
|
||||
|
||||
it("should work with hash", () => {
|
||||
expect(
|
||||
parseCollectionSlug(
|
||||
"http://mywiki.getoutline.com/collection/test-ANzZwgv2RG#state"
|
||||
)
|
||||
).toEqual("test-ANzZwgv2RG");
|
||||
});
|
||||
|
||||
it("should work with subdomain qualified url", () => {
|
||||
expect(
|
||||
parseCollectionSlug(
|
||||
"http://mywiki.getoutline.com/collection/test-ANzZwgv2RG"
|
||||
)
|
||||
).toEqual("test-ANzZwgv2RG");
|
||||
});
|
||||
|
||||
it("should work with path", () => {
|
||||
expect(parseCollectionSlug("/collection/test-ANzZwgv2RG")).toEqual(
|
||||
"test-ANzZwgv2RG"
|
||||
);
|
||||
});
|
||||
|
||||
it("should work with path and hash", () => {
|
||||
expect(parseCollectionSlug("/collection/test-ANzZwgv2RG#somehash")).toEqual(
|
||||
"test-ANzZwgv2RG"
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user