// Tests for Syndria98/dragonroll#63: the item rows in the campaign sidebar dropped the text // listing category, rarity and quantity — the rarity colours the text of the entry instead // (common white, uncommon green, rare blue, very rare purple, legendary orange) — and the // quantity left the item surfaces altogether, since it only belongs to an actor's inventory. // // The repository root installs no dependencies, so these read the sources the way // tests/item-entry-display.test.js does — the checks are about the markup and style. // // Run with `npm test` from the repository root, or `node --test tests/`. const { test } = require("node:test"); const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); const read = (...parts) => fs.readFileSync(path.join(__dirname, "..", ...parts), "utf8"); const sidebarSource = read("frontend", "app", "components", "partials", "ContentSidebar.vue"); const itemWindowSource = read("frontend", "app", "components", "windows", "ItemSheetWindow.vue"); const entryFormSource = read("frontend", "app", "components", "windows", "CreateCampaignEntryWindow.vue"); const sheetSource = read("frontend", "app", "components", "windows", "CharacterSheetWindow.vue"); const colorsSource = read("frontend", "app", "assets", "css", "colors.scss"); // The block that renders the item rows, as in tests/item-entry-display.test.js. const itemSection = /