style / tools optis & new tools calculator
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s

This commit is contained in:
Shinuwa 2026-07-23 21:06:05 +02:00
parent 6b84607b25
commit 0db35a0d2c
23 changed files with 1106 additions and 24 deletions

View file

@ -67,6 +67,16 @@ export function validateSiteContent(site) {
"toolboxes.summary",
"toolboxes.storageHelp.title",
"toolboxes.storageHelp.text",
"toolboxes.modules.notepad.placeholder",
"toolboxes.modules.checklist.itemPlaceholder",
"toolboxes.modules.checklist.importPlaceholder",
"toolboxes.modules.links.titlePlaceholder",
"toolboxes.modules.links.urlPlaceholder",
"toolboxes.modules.links.importPlaceholder",
"toolboxes.modules.counters.labelPlaceholder",
"toolboxes.modules.calculator.expressionPlaceholder",
"toolboxes.modules.calculator.labelPlaceholder",
"toolboxes.modules.calculator.scrollableTitle",
"toolboxes.emptyTitle",
"toolboxes.emptyText"
].forEach((path) => assertNonEmptyString(site, path));

View file

@ -26,6 +26,7 @@ test("react application defines the expected local toolbox primitives", async ()
const iconComponent = await readFile("website/src/components/Icon.jsx", "utf8");
const gamesPage = await readFile("website/src/features/games/GamesPage.jsx", "utf8");
const gameRoute = await readFile("website/src/features/games/GameRoute.jsx", "utf8");
const checklistCopyButton = await readFile("website/src/features/games/CopyChecklistItemsButton.jsx", "utf8");
const gameLoaders = await readFile("website/src/features/games/loaders.js", "utf8");
const gameFiltersPanel = await readFile("website/src/features/games/GameFiltersPanel.jsx", "utf8");
const diablo4Page = await readFile("website/src/features/games/diablo4/Diablo4Page.jsx", "utf8");
@ -42,10 +43,12 @@ test("react application defines the expected local toolbox primitives", async ()
const damageTable = await readFile("website/src/features/games/mhwilds/cards/DamageTable.jsx", "utf8");
const moduleRegistry = await readFile("website/src/features/toolboxes/modules/index.jsx", "utf8");
const notepadModule = await readFile("website/src/features/toolboxes/modules/NotepadModule.jsx", "utf8");
const calculatorModule = await readFile("website/src/features/toolboxes/modules/CalculatorModule.jsx", "utf8");
const checklistModule = await readFile("website/src/features/toolboxes/modules/ChecklistModule.jsx", "utf8");
const screenshotsModule = await readFile("website/src/features/toolboxes/modules/ScreenshotsModule.jsx", "utf8");
const linksModule = await readFile("website/src/features/toolboxes/modules/LinksModule.jsx", "utf8");
const countersModule = await readFile("website/src/features/toolboxes/modules/CountersModule.jsx", "utf8");
const textImport = await readFile("website/src/features/toolboxes/modules/textImport.js", "utf8");
const reorderHook = await readFile("website/src/hooks/usePointerReorder.js", "utf8");
assert.match(source, /sokkog:toolboxes/);
@ -64,11 +67,18 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(styleHome, /\.dialogue-line i/);
assert.match(styleHome, /font-style: italic/);
assert.match(styleToolboxes, /\.module-icon-abacus/);
assert.match(styleToolboxes, /\.module-icon-calculator/);
assert.match(styleToolboxes, /\.calculator-module/);
assert.match(styleToolboxes, /\.toolbox-icon-picker/);
assert.match(styleToolboxes, /\.toolbox-game-icon/);
assert.match(styleToolboxes, /\.toolbox-hero-link/);
assert.match(styleToolboxes, /\.toolbox-actions-row/);
assert.match(styleToolboxes, /\.text-import-form/);
assert.match(styleIcons, /ui-icon-drag/);
assert.match(styleIcons, /ui-icon-dropdown/);
assert.match(styleIcons, /ui-icon-enter/);
assert.match(styleIcons, /ui-icon-calculator/);
assert.match(styleIcons, /ui-icon-scrollable/);
assert.match(styleIcons, /ui-icon-flip/);
assert.match(styleIcons, /ui-icon-add/);
assert.match(styleMhwilds, /\.mhwilds-card/);
@ -91,6 +101,10 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(gameRoute, /export function GameRoute/);
assert.match(gameRoute, /MhwildsPage/);
assert.match(gameRoute, /Diablo4Page/);
assert.match(checklistCopyButton, /formatChecklistImportItems/);
assert.match(checklistCopyButton, /\$\{label\}:1/);
assert.match(checklistCopyButton, /navigator\.clipboard\.writeText/);
assert.match(checklistCopyButton, /results-copy-button/);
assert.match(gameLoaders, /export async function loadMhwildsData/);
assert.match(gameLoaders, /export async function loadDiablo4Data/);
assert.match(gameLoaders, /\/data\/diablo4\/affixes_types\.json/);
@ -100,6 +114,7 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(diablo4Page, /export function Diablo4Page/);
assert.match(diablo4Overview, /export function Diablo4Overview/);
assert.match(diablo4Listing, /export function Diablo4Listing/);
assert.match(diablo4Listing, /CopyChecklistItemsButton/);
assert.match(diablo4Filters, /export function Diablo4Filters/);
assert.match(diablo4Filters, /GameFiltersPanel/);
assert.match(diablo4AffixCard, /export function Diablo4AffixCard/);
@ -108,6 +123,7 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(diablo4Utils, /getCategoryIconStyle/);
assert.match(mhwildsPage, /export function MhwildsPage/);
assert.match(mhwildsListing, /export function MhwildsListing/);
assert.match(mhwildsListing, /CopyChecklistItemsButton/);
assert.match(mhwildsListing, /endemic_life/);
assert.match(mhwildsFilters, /export function MhwildsFilters/);
assert.match(mhwildsFilters, /GameFiltersPanel/);
@ -124,13 +140,32 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(moduleRegistry, /screenshots:/);
assert.match(moduleRegistry, /links:/);
assert.match(moduleRegistry, /counters:/);
assert.match(moduleRegistry, /calculator:/);
assert.match(moduleRegistry, /editable: false/);
assert.match(moduleRegistry, /module-edit-button/);
assert.match(notepadModule, /export function NotepadModule/);
assert.match(calculatorModule, /export function CalculatorModule/);
assert.match(calculatorModule, /calculateExpression/);
assert.match(calculatorModule, /activeParentId/);
assert.match(calculatorModule, /parentId/);
assert.match(calculatorModule, /scrollResults/);
assert.match(calculatorModule, /calculator-scroll-toggle/);
assert.match(calculatorModule, /EditableCalculatorLabel/);
assert.match(calculatorModule, /calculator-entry-label/);
assert.match(calculatorModule, /copyChecklistImport/);
assert.match(calculatorModule, /resetCalculator/);
assert.match(calculatorModule, /Quantité non modifiable/);
assert.doesNotMatch(styleToolboxes, /lecture seule/);
assert.match(calculatorModule, /entry\.label \|\| formatResult\(entry\.value\)/);
assert.match(calculatorModule, /ResizeObserver/);
assert.match(calculatorModule, /--calculator-scroll-height/);
assert.match(calculatorModule, /CalculatorEntries/);
assert.match(checklistModule, /export function ChecklistModule/);
assert.match(screenshotsModule, /export function ScreenshotsModule/);
assert.match(linksModule, /export function LinksModule/);
assert.match(countersModule, /export function CountersModule/);
assert.match(textImport, /export function parseColonImportLines/);
assert.match(textImport, /line\.indexOf\(":\"\)/);
assert.match(checklistModule, /editing &&/);
assert.match(screenshotsModule, /editing &&/);
assert.match(linksModule, /editing &&/);
@ -163,6 +198,11 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(source, /value\.split\("\\n"\)/);
assert.match(source, /<br key=/);
assert.match(source, /getToolboxGame\(toolbox\)/);
assert.match(source, /Vers la page de jeu/);
assert.match(source, /Vers la toolbox complète/);
assert.match(source, /#\/games\/\$\{toolboxGame\.id\}/);
assert.match(source, /#\/toolbox\/\$\{toolbox\.id\}/);
assert.match(source, /setDrawerGameId\(""\)/);
assert.match(source, /toolbox-card-cover-link/);
assert.match(source, /toolbox-icon-cover/);
assert.match(source, /moduleColumns/);
@ -184,7 +224,14 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(source, /qtyCurrent/);
assert.match(source, /normalizeLinksData/);
assert.match(source, /normalizeCountersData/);
assert.match(source, /normalizeCalculatorData/);
assert.match(source, /scrollResults/);
assert.match(checklistModule, /ChecklistItem/);
assert.match(checklistModule, /parseColonImportLines/);
assert.match(checklistModule, /Number\.parseInt/);
assert.match(checklistModule, /checklist-qty-current/);
assert.match(linksModule, /parseColonImportLines/);
assert.match(linksModule, /context\.normalizeUrl/);
assert.match(screenshotsModule, /clipboardData/);
assert.match(source, /async function addScreenshotFiles/);
assert.match(source, /function ScreenshotViewer/);
@ -217,7 +264,10 @@ test("legacy svg icons are available for reuse", async () => {
await readFile("website/public/static/icons/columns.svg", "utf8");
await readFile("website/public/static/icons/copy.svg", "utf8");
await readFile("website/public/static/icons/abacus.svg", "utf8");
await readFile("website/public/static/icons/calculator.svg", "utf8");
await readFile("website/public/static/icons/enter.svg", "utf8");
await readFile("website/public/static/icons/export.svg", "utf8");
await readFile("website/public/static/icons/scrollable.svg", "utf8");
await readFile("website/public/static/icons/notepad.svg", "utf8");
await readFile("website/public/static/icons/picture.svg", "utf8");
await readFile("website/public/static/icons/rows.svg", "utf8");

View file

@ -0,0 +1,16 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { parseColonImportLines } from "../website/src/features/toolboxes/modules/textImport.js";
test("colon text import keeps urls intact after the first separator", () => {
assert.deepEqual(parseColonImportLines("Build:https://example.com/build?class=rogue\nPotion:10"), [
{ label: "Build", value: "https://example.com/build?class=rogue" },
{ label: "Potion", value: "10" }
]);
});
test("colon text import accepts labels without value", () => {
assert.deepEqual(parseColonImportLines("Simple item"), [
{ label: "Simple item", value: "" }
]);
});