add list page and multiples optis
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s

This commit is contained in:
Shinuwa 2026-07-24 16:14:14 +02:00
parent d9d22683dc
commit 959fa42454
30 changed files with 1015 additions and 45 deletions

View file

@ -19,6 +19,7 @@ test("mhwilds data and assets are available", async () => {
const games = JSON.parse(await readFile("website/public/data/games.json", "utf8"));
const monsters = JSON.parse(await readFile("website/public/data/mhwilds/monsters.json", "utf8"));
const endemicLife = JSON.parse(await readFile("website/public/data/mhwilds/endemic_life.json", "utf8"));
const listIndex = JSON.parse(await readFile("website/public/data/mhwilds/lists/index.json", "utf8"));
const translations = JSON.parse(await readFile("website/public/data/mhwilds/i18n/fr.json", "utf8"));
const enTranslations = JSON.parse(await readFile("website/public/data/mhwilds/i18n/en.json", "utf8"));
const listingSource = await readFile("website/src/features/games/mhwilds/MhwildsListing.jsx", "utf8");
@ -39,6 +40,27 @@ test("mhwilds data and assets are available", async () => {
assert.ok(endemicLife.locations.length > 0, "endemicLife.locations must not be empty");
assert.ok(endemicLife.endemicLife.length > 0);
validateEndemicData(endemicLife);
assert.ok(Array.isArray(listIndex.lists), "mhwilds list index must expose lists");
assert.ok(listIndex.lists.length >= 1, "mhwilds list index must contain at least one list");
for (const list of listIndex.lists) {
assert.equal(typeof list.id, "string", "mhwilds list id must be a string");
assert.equal(typeof list.title, "string", "mhwilds list title must be a string");
assert.match(list.file, /\.json$/, "mhwilds list file must target a json file");
const listData = JSON.parse(await readFile(`website/public/data/mhwilds/lists/${list.file}`, "utf8"));
assert.equal(typeof listData.titre, "string", `${list.file}.titre must be a string`);
assert.ok(listData.titre.trim(), `${list.file}.titre must not be empty`);
for (const [category, items] of Object.entries(listData).filter(([key]) => key !== "titre")) {
assert.ok(Array.isArray(items), `mhwilds list category ${category} must be an array`);
items.forEach((item, index) => {
assert.equal(typeof item.nom, "string", `${list.file}.${category}[${index}].nom must be a string`);
assert.ok(item.nom.trim(), `${list.file}.${category}[${index}].nom must not be empty`);
assert.equal(typeof item.description, "string", `${list.file}.${category}[${index}].description must be a string`);
if (item.quantite !== undefined) {
assert.ok(Number.isFinite(Number(item.quantite)), `${list.file}.${category}[${index}].quantite must be numeric`);
}
});
}
}
validateTranslationKeys(translations, "fr");
validateTranslationKeys(enTranslations, "en");
assert.equal(translations.monsters, "monstres");

View file

@ -65,6 +65,13 @@ export function validateSiteContent(site) {
"about.description",
"about.toolsTitle",
"about.limitsTitle",
"about.contribute.eyebrow",
"about.contribute.title",
"about.contribute.description",
"about.contribute.example",
"about.contribute.promptTitle",
"about.contribute.promptIntro",
"about.contribute.promptText",
"toolboxes.eyebrow",
"toolboxes.title",
"toolboxes.newButton",

View file

@ -30,6 +30,7 @@ test("react application defines the expected local toolbox primitives", async ()
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 gameListsPage = await readFile("website/src/features/games/GameListsPage.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");
@ -39,7 +40,9 @@ test("react application defines the expected local toolbox primitives", async ()
const diablo4AffixCard = await readFile("website/src/features/games/diablo4/Diablo4AffixCard.jsx", "utf8");
const diablo4Utils = await readFile("website/src/features/games/diablo4/utils.js", "utf8");
const mhwildsPage = await readFile("website/src/features/games/mhwilds/MhwildsPage.jsx", "utf8");
const mhwildsOverview = await readFile("website/src/features/games/mhwilds/MhwildsOverview.jsx", "utf8");
const mhwildsListing = await readFile("website/src/features/games/mhwilds/MhwildsListing.jsx", "utf8");
const mhwildsLists = await readFile("website/src/features/games/mhwilds/MhwildsLists.jsx", "utf8");
const mhwildsFilters = await readFile("website/src/features/games/mhwilds/MhwildsFilters.jsx", "utf8");
const monsterCard = await readFile("website/src/features/games/mhwilds/cards/MonsterCard.jsx", "utf8");
const endemicCard = await readFile("website/src/features/games/mhwilds/cards/EndemicCard.jsx", "utf8");
@ -123,10 +126,19 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(gameRoute, /MhwildsPage/);
assert.match(gameRoute, /Diablo4Page/);
assert.match(checklistCopyButton, /formatChecklistImportItems/);
assert.match(checklistCopyButton, /\$\{label\}:1/);
assert.match(checklistCopyButton, /formatChecklistImportSections/);
assert.match(checklistCopyButton, /\$\{entry\.label\}:\$\{entry\.quantity\}/);
assert.match(checklistCopyButton, /# \$\{title\}/);
assert.match(checklistCopyButton, /navigator\.clipboard\.writeText/);
assert.match(checklistCopyButton, /results-copy-button/);
assert.match(gameListsPage, /export function GameListsPage/);
assert.match(gameListsPage, /game-list-selector/);
assert.match(gameListsPage, /game-list-create-button/);
assert.match(gameListsPage, /module-icon-checklist/);
assert.match(gameLoaders, /export async function loadMhwildsData/);
assert.match(gameLoaders, /\/data\/mhwilds\/lists\/index\.json/);
assert.match(gameLoaders, /loadGameLists/);
assert.match(gameLoaders, /normalizeGameListFile/);
assert.match(gameLoaders, /export async function loadDiablo4Data/);
assert.match(gameLoaders, /\/data\/diablo4\/affixes_types\.json/);
assert.match(gameLoaders, /filterOptionKeys/);
@ -143,7 +155,14 @@ test("react application defines the expected local toolbox primitives", async ()
assert.match(diablo4Utils, /getFilteredDiablo4Affixes/);
assert.match(diablo4Utils, /getCategoryIconStyle/);
assert.match(mhwildsPage, /export function MhwildsPage/);
assert.match(mhwildsPage, /MhwildsLists/);
assert.match(mhwildsPage, /linkedToolboxId/);
assert.match(mhwildsOverview, /#\/games\/mhwilds\/lists/);
assert.match(mhwildsListing, /export function MhwildsListing/);
assert.match(mhwildsListing, /GameBreadcrumb/);
assert.match(mhwildsLists, /export function MhwildsLists/);
assert.match(mhwildsLists, /GameListsPage/);
assert.match(mhwildsLists, /selectedListId/);
assert.match(mhwildsListing, /CopyChecklistItemsButton/);
assert.match(mhwildsListing, /endemic_life/);
assert.match(mhwildsFilters, /export function MhwildsFilters/);