This commit is contained in:
Zef Hemel
2026-07-28 13:56:28 +02:00
parent d1a99ca500
commit c135bcbdb7
5 changed files with 14 additions and 14 deletions
+4 -1
View File
@@ -27,7 +27,10 @@ test("description is the snippet's first line plus the page", () => {
});
test("description uses only the first line of a multi-line snippet", () => {
const multi = { ...base, snippet: "- Item $ii\n - child one\n - child two" };
const multi = {
...base,
snippet: "- Item $ii\n - child one\n - child two",
};
expect(anchorDescription(multi)).toBe("- Item $ii — Finances");
});
+1 -4
View File
@@ -17,10 +17,7 @@ import {
type Ref,
} from "@silverbulletmd/silverbullet/lib/ref";
import { folderName } from "@silverbulletmd/silverbullet/lib/resolve";
import {
type AnchorObject,
anchorsToFilterOptions,
} from "./anchor_options.ts";
import { type AnchorObject, anchorsToFilterOptions } from "./anchor_options.ts";
const tagRegex = new RegExp(mdTagRegex.source, "g");
@@ -1,9 +1,5 @@
import { Fragment } from "preact";
import {
Button,
Input,
UrlPrefixInput,
} from "@silverbulletmd/silverbullet/ui";
import { Button, Input, UrlPrefixInput } from "@silverbulletmd/silverbullet/ui";
import { FolderPicker } from "../../FolderPicker.tsx";
import { FieldErrors } from "../../space_fields.tsx";
import type { FieldError } from "../../types.ts";
+5 -1
View File
@@ -1,5 +1,9 @@
import { useState } from "preact/hooks";
import { Alert, prefixFromName, slugify } from "@silverbulletmd/silverbullet/ui";
import {
Alert,
prefixFromName,
slugify,
} from "@silverbulletmd/silverbullet/ui";
import type { FieldError } from "./types.ts";
/**
+3 -3
View File
@@ -198,8 +198,8 @@ test.describe("Page picker anchor mode with a duplicate anchor name", () => {
// error path and never navigate anywhere. Landing on Beta confirms the
// picker qualified the ref with the page the clicked row belongs to.
await expect(modal).not.toBeVisible();
await expect(
sbPage.locator("#sb-current-page input.sb-input"),
).toHaveValue("Beta");
await expect(sbPage.locator("#sb-current-page input.sb-input")).toHaveValue(
"Beta",
);
});
});