feat(userscript): stamp and filter by kind in the manga script
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user