fix: thumbnails via image() relative to appHome, paste dir from appHome
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
dd95bf2c68
commit
65b66f86cd
3 files changed
+60
-6
No files matched your search
@@ -70,3 +70,22 @@ test("formatBytes", () => {
|
||||
assert.equal(formatBytes(undefined), "");
|
||||
assert.equal(formatBytes(NaN), "");
|
||||
});
|
||||
|
||||
import { relativeTo } from "../mod/ovis-composer/attachments.js";
|
||||
|
||||
test("relativeTo: a file inside the folder, forward slashes, any case", () => {
|
||||
assert.equal(
|
||||
relativeTo("C:\\Users\\Factor\\.config\\herdr-app", "C:\\Users\\Factor\\.config\\herdr-app\\data\\ovis-composer\\paste\\paste-1.png"),
|
||||
"data/ovis-composer/paste/paste-1.png",
|
||||
);
|
||||
assert.equal(relativeTo("c:/users/factor/.config/herdr-app/", "C:\\Users\\Factor\\.config\\herdr-app\\a b\\ę.png"), "a b/ę.png");
|
||||
});
|
||||
|
||||
test("relativeTo: outside the folder, the folder itself, or rubbish is nothing", () => {
|
||||
assert.equal(relativeTo("C:\\app", "D:\\pics\\a.png"), null);
|
||||
assert.equal(relativeTo("C:\\app", "C:\\application\\a.png"), null);
|
||||
assert.equal(relativeTo("C:\\app", "C:\\app"), null);
|
||||
assert.equal(relativeTo("C:\\app", "C:\\app\\"), null);
|
||||
assert.equal(relativeTo("", "C:\\a.png"), null);
|
||||
assert.equal(relativeTo("C:\\app", undefined), null);
|
||||
});
|
||||
Reference in new issue
Block a user