More things
Some checks failed
Test / test (push) Failing after 5s
Build and Deploy Nuxt / build (push) Successful in 2m3s

This commit is contained in:
2026-11-20 18:59:01 +01:00
parent b83f64ff9e
commit d61659cfdd
51 changed files with 1777 additions and 3817 deletions

View File

@@ -16,6 +16,10 @@ const source = fs.readFileSync(
path.join(__dirname, "..", "frontend", "app", "components", "partials", "ContentSidebar.vue"),
"utf8"
);
const noteListSource = fs.readFileSync(
path.join(__dirname, "..", "frontend", "app", "components", "partials", "NestedNoteList.vue"),
"utf8"
);
// `selector` is inserted verbatim, so escape the `.` of a class combination (`entity-entry\\.anchored`).
// A trailing `\.entity-entry\s*\{` cannot match `.entity-entry:hover` or `.entity-entry-name`, so the
@@ -86,3 +90,22 @@ test("a long entry name wraps instead of pushing the entry out of the sidebar",
assert.ok(name, "expected a .entity-entry-name style rule");
assert.match(name, /(word-break|overflow-wrap):/, "an unbreakable name has to wrap inside the entry");
});
test("every entity entry leads with the icon of what it is", () => {
for (const icon of ["user.svg", "box.svg", "map.svg"]) {
assert.match(source, new RegExp(`class="entity-entry-icon"[^>]*${icon.replace('.', '\\.')}`),
`expected the ${icon} icon on an entry row`);
}
// An item that brings its own picture still has the type icon when it carries none.
assert.match(source, /v-else class="entity-entry-icon"[^>]*box\.svg/);
const icon = ruleFor("entity-entry-icon");
assert.ok(icon, "expected a .entity-entry-icon style rule");
assert.match(declaration(icon, "width"), /^\d+px$/);
});
test("note rows lead with the page icon and media rows with the icon of their type", () => {
assert.match(noteListSource, /class="note-link-icon"[^>]*journal-page\.svg/);
assert.match(noteListSource, /v-for="item in media"[\s\S]*media-link-icon/);
});