test(server/utils): add edge case test for getNoteTitle

when the noteMeta title consists of just spaces, it should fall back to "normal" handling again → currently this fails
This commit is contained in:
Panagiotis Papadopoulos 2025-01-31 21:39:42 +01:00
parent 65be2cf048
commit 46f28f4f09

View File

@ -270,6 +270,12 @@ describe("#getNoteTitle", () => {
//@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here
["test_file.md", true, { title: ""}],
"test file"
],
[
"when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed",
//@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here
["test_file.json", false, { title: " "}],
"test_file.json"
]
];