Skip to content

Commit

Permalink
test: Update tests based on Links.ify changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed May 5, 2024
1 parent e814d96 commit 07e407c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
28 changes: 14 additions & 14 deletions tests/commands/list_index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ describe("build", () => {

expect(list_index).toBe(
[
"- [[2.md]] (field=down explicit=true)",
".- [[2.2.md]] (field=down explicit=true)",
"..- [[2.2.2.md]] (field=down explicit=true)",
"..- [[2.2.1.md]] (field=down explicit=true)",
".- [[2.1.md]] (field=down explicit=true)",
"..- [[2.1.2.md]] (field=down explicit=true)",
"..- [[2.1.1.md]] (field=down explicit=true)",
"- [[1.md]] (field=down explicit=true)",
".- [[1.2.md]] (field=down explicit=true)",
"..- [[1.2.2.md]] (field=down explicit=true)",
"..- [[1.2.1.md]] (field=down explicit=true)",
".- [[1.1.md]] (field=down explicit=true)",
"..- [[1.1.2.md]] (field=down explicit=true)",
"..- [[1.1.1.md]] (field=down explicit=true)",
"- [[2]] (field=down explicit=true)",
".- [[2.2]] (field=down explicit=true)",
"..- [[2.2.2]] (field=down explicit=true)",
"..- [[2.2.1]] (field=down explicit=true)",
".- [[2.1]] (field=down explicit=true)",
"..- [[2.1.2]] (field=down explicit=true)",
"..- [[2.1.1]] (field=down explicit=true)",
"- [[1]] (field=down explicit=true)",
".- [[1.2]] (field=down explicit=true)",
"..- [[1.2.2]] (field=down explicit=true)",
"..- [[1.2.1]] (field=down explicit=true)",
".- [[1.1]] (field=down explicit=true)",
"..- [[1.1.2]] (field=down explicit=true)",
"..- [[1.1.1]] (field=down explicit=true)",
"",
].join("\n"),
);
Expand Down
7 changes: 4 additions & 3 deletions tests/utils/links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Links } from "src/utils/links";
import { describe, test } from "vitest";

describe("Links.ify", () => {
const path = "folder/note.md";
const display = "display";
const no_ext = "folder/note";
const path = "folder/note.md";

test("kind:none", (t) => {
t.expect(
Expand All @@ -26,15 +27,15 @@ describe("Links.ify", () => {
Links.ify(path, path, {
link_kind: "wiki",
}),
).toBe(`[[${path}]]`);
).toBe(`[[${no_ext}]]`);
});

test("kind:wiki (display)", (t) => {
t.expect(
Links.ify(path, display, {
link_kind: "wiki",
}),
).toBe(`[[${path}|${display}]]`);
).toBe(`[[${no_ext}|${display}]]`);
});

test("kind:markdown", (t) => {
Expand Down

0 comments on commit 07e407c

Please sign in to comment.