feat(userscript): stamp and filter by kind in the manga script

This commit is contained in:
2026-08-06 03:22:28 +07:00
parent d465028443
commit 51fcd8732b
2 changed files with 31 additions and 2 deletions
+15
View File
@@ -60,6 +60,7 @@ const {
kagane,
anchorsFromHTML,
statusOf,
kindOf,
} = require("../manga-bookmark.user.js");
// detect() reads only these four properties off location.
@@ -377,3 +378,17 @@ test("statusOf defaults a missing status to reading", () => {
assert.equal(statusOf({ status: "archived" }), "archived");
assert.equal(statusOf({ status: "finished" }), "finished");
});
// ============================================================
// kindOf — a row written before the kind column existed has none, and every
// one of those is manga.
// ============================================================
test("kindOf defaults a missing kind to manga", () => {
assert.equal(kindOf({}), "manga");
assert.equal(kindOf({ kind: "" }), "manga");
});
test("kindOf passes through an explicit kind", () => {
assert.equal(kindOf({ kind: "novel" }), "novel");
});