Fix: support renaming pages/files with different casing

This commit is contained in:
Zef Hemel
2026-08-04 09:38:09 +02:00
parent 248f2694bc
commit e373d7393f
12 changed files with 1034 additions and 33 deletions
+25
View File
@@ -68,4 +68,29 @@ test.describe("Top-bar page rename", () => {
await sbPage.keyboard.press(`${mod}+k`);
await expect(sbPage.locator(".sb-modal-box")).toBeVisible();
});
test("rename to a different casing of the same name", async ({
sbPage,
sbServer,
}) => {
await gotoSilverBulletPage(sbPage, sbServer, "OldName");
const nameInput = sbPage.locator("#sb-current-page input.sb-input");
await nameInput.click();
await sbPage.keyboard.press(`${mod}+a`);
await sbPage.keyboard.type("oldname");
await sbPage.keyboard.press("Enter");
await sbPage.waitForURL(/\/oldname$/);
const resp = await fetch(`${sbServer.url}/.fs/oldname.md`);
expect(resp.ok).toBe(true);
expect(await resp.text()).toContain("Content to keep");
// Exactly one file, under the new casing.
const listResp = await fetch(`${sbServer.url}/.fs`);
const names = (await listResp.json()).map((f: { name: string }) => f.name);
expect(names).toContain("oldname.md");
expect(names).not.toContain("OldName.md");
});
});