Reorganise the visual lab and mythic variations around a Holo and Particles panel
The visual lab becomes a single bench: one thumbnail per holographic effect picks the effect, and a large card sits beside the shared customisation panel. The mythic editor shows its variations as a row of thumbnails above the settings of the selected one, with a large card preview, and saves them with a single Enregistrer / Annuler pair instead of saving each slider. Formats and effects whose files a card lacks stay in their menu, disabled at the bottom with the missing files listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
808adadc0c
commit
9f70bea523
13 changed files with 621 additions and 343 deletions
|
|
@ -656,60 +656,98 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
await expect(mythicEditorPanel.getByRole("heading", { name: "Version mythique · Dragon du Néant Étoilé" })).toBeVisible();
|
||||
await expect(mythicEditorPanel.getByRole("heading", { name: "Ouverture mythique de la carte" })).toBeVisible();
|
||||
await expect(mythicEditorPanel.locator(".nebula-admin-card-opening-block .nebula-card")).toHaveAttribute("data-card-size", "md");
|
||||
const trashButton = mythicEditorPanel.getByRole("button", { name: "Supprimer la variation Prisme spectral — Cosmique" });
|
||||
await expect(trashButton).toHaveAttribute("data-variant", "danger");
|
||||
await expect(trashButton).toHaveClass(/nds-icon-button/);
|
||||
await expect(trashButton).not.toHaveText(/./);
|
||||
await expect(mythicEditorPanel.getByRole("button", { name: "Retirer Prisme spectral — Aurore des tirages" })).toHaveClass(/ui-tooltip-anchor/);
|
||||
const dragonVariations = mythicEditorPanel.locator(".nebula-admin-mythic-variation");
|
||||
await expect(dragonVariations).toHaveCount(2);
|
||||
await expect(dragonVariations.locator("strong")).toHaveText(["Aurore", "Cosmique"]);
|
||||
await expect(dragonVariations.locator('.nebula-card[data-card-size="sm"]')).toHaveCount(2);
|
||||
await expect(mythicEditorPanel.getByRole("button", { name: "Ajouter une variation" })).toBeVisible();
|
||||
await dragonVariations.nth(1).getByRole("button", { name: "Prévisualiser Prisme spectral — Cosmique" }).click();
|
||||
await dragonVariations.nth(1).getByRole("button", { name: "Régler Prisme spectral — Cosmique" }).click();
|
||||
await expect(dragonVariations.nth(1)).toHaveAttribute("data-selected", "true");
|
||||
await expect(mythicEditorPanel.locator(".nebula-admin-card-opening-block")).toContainText("Prisme spectral — Cosmique");
|
||||
// La variation sélectionnée se règle dans un panneau à onglets : Holo, puis Particules, sans animation pour l'instant.
|
||||
const cosmicSettings = mythicEditorPanel.getByRole("region", { name: "Réglages de Prisme spectral — Cosmique" });
|
||||
await expect(cosmicSettings.getByRole("tab")).toHaveText(["Holo", "Particules"]);
|
||||
// Un effet dont la carte n'a pas les fichiers reste visible mais désactivé, avec la liste des fichiers manquants.
|
||||
await selectTrigger(cosmicSettings, "Effet").click();
|
||||
await expect(cosmicSettings.getByRole("option")).toHaveText(["Prisme spectral", "Reflet diffractif", "Glace brisée", /^Parallaxe prismatique/]);
|
||||
const parallaxOption = cosmicSettings.getByRole("option", { name: /^Parallaxe prismatique/ });
|
||||
await expect(parallaxOption).toBeDisabled();
|
||||
await expect(parallaxOption.locator(".nds-select-option-hint")).toHaveText("Fichiers manquants : __cutout et __backdrop");
|
||||
await page.keyboard.press("Escape");
|
||||
// La corbeille de la variation sélectionnée est dans l'en-tête de son panneau.
|
||||
const trashButton = cosmicSettings.getByRole("button", { name: "Supprimer la variation Prisme spectral — Cosmique" });
|
||||
await expect(trashButton).toHaveAttribute("data-variant", "danger");
|
||||
await expect(trashButton).toHaveClass(/nds-icon-button/);
|
||||
await expect(trashButton).not.toHaveText(/./);
|
||||
await cosmicSettings.getByRole("tab", { name: "Particules" }).click();
|
||||
await expect(selectTrigger(cosmicSettings, "Animation")).toBeDisabled();
|
||||
await expect(selectTrigger(cosmicSettings, "Animation")).toHaveText("Aucune");
|
||||
await cosmicSettings.getByRole("tab", { name: "Holo" }).click();
|
||||
// Changer la finition d'une variation possédée : confirmation, même identifiant, nouvelle finition visible.
|
||||
await mythicEditorPanel.getByRole("button", { name: "Changer la finition de Prisme spectral — Aurore" }).click();
|
||||
const auroraVariation = mythicEditorPanel.getByRole("group", { name: "Prisme spectral — Aurore" });
|
||||
await expect(mythicEditorPanel.getByRole("button", { name: "Ajouter une variation" })).toBeDisabled();
|
||||
const validateFinish = auroraVariation.getByRole("button", { name: "Valider la nouvelle finition de Prisme spectral — Aurore" });
|
||||
await expect(validateFinish).toBeDisabled();
|
||||
await auroraVariation.getByLabel("Palette holographique").click();
|
||||
await auroraVariation.getByRole("button", { name: "Cosmique", exact: true }).click();
|
||||
await expect(auroraVariation.getByRole("status")).toHaveText("Cette combinaison existe déjà.");
|
||||
await expect(validateFinish).toBeDisabled();
|
||||
await auroraVariation.getByLabel("Palette holographique").click();
|
||||
await auroraVariation.getByRole("button", { name: "Solaire", exact: true }).click();
|
||||
await dragonVariations.first().getByRole("button", { name: "Régler Prisme spectral — Aurore" }).click();
|
||||
const auroraSettings = mythicEditorPanel.getByRole("region", { name: "Réglages de Prisme spectral — Aurore" });
|
||||
const saveAurora = auroraSettings.getByRole("button", { name: "Enregistrer" });
|
||||
await expect(saveAurora).toBeDisabled();
|
||||
await auroraSettings.getByLabel("Palette holographique").click();
|
||||
await auroraSettings.getByRole("button", { name: "Cosmique", exact: true }).click();
|
||||
await expect(auroraSettings.getByRole("status")).toHaveText("Cette combinaison existe déjà.");
|
||||
await expect(saveAurora).toBeDisabled();
|
||||
await auroraSettings.getByLabel("Palette holographique").click();
|
||||
await auroraSettings.getByRole("button", { name: "Solaire", exact: true }).click();
|
||||
await expect(mythicEditorPanel.locator(".nebula-admin-card-opening-block")).toContainText("Prisme spectral — Solaire");
|
||||
await validateFinish.click();
|
||||
await expect(dragonVariations.first()).toHaveAttribute("data-modified", "true");
|
||||
await expect(dragonVariations.first()).toContainText("Non enregistrée");
|
||||
await saveAurora.click();
|
||||
const finishDialog = page.getByRole("dialog", { name: "Changer la finition de Prisme spectral — Aurore ?" });
|
||||
// D'autres parcours peuvent tirer cette variation : le nombre de joueurs varie selon l'ordre des tests.
|
||||
await expect(finishDialog).toContainText(/Les joueurs qui la possèdent \(\d+\) verront Prisme spectral — Solaire à la place\./);
|
||||
await finishDialog.getByRole("button", { name: "Changer la finition" }).click();
|
||||
await expect(dragonVariations.locator("strong")).toHaveText(["Solaire", "Cosmique"]);
|
||||
await expect(dragonVariations.first()).not.toHaveAttribute("data-modified");
|
||||
const changedConfig = await page.evaluate(() => globalThis.fetch("/api/cards/config").then((response) => response.json()));
|
||||
expect(changedConfig.catalog.editions.find((edition) => edition.id === "starvoid-dragon-spectral-prism-aurora")?.finishIds).toEqual(["spectral-prism-solar"]);
|
||||
// « Annuler » oublie le réglage en cours sans rien enregistrer.
|
||||
const solarSettings = mythicEditorPanel.getByRole("region", { name: "Réglages de Prisme spectral — Solaire" });
|
||||
await solarSettings.getByLabel("Palette holographique").click();
|
||||
await solarSettings.getByRole("button", { name: "Aurore", exact: true }).click();
|
||||
await solarSettings.getByRole("button", { name: "Annuler" }).click();
|
||||
await expect(solarSettings.getByRole("button", { name: "Palette holographique : Solaire" })).toBeVisible();
|
||||
await expect(dragonVariations.first()).not.toHaveAttribute("data-modified");
|
||||
// Retour à la finition d'origine : la suite du parcours retrouve l'état de départ.
|
||||
await mythicEditorPanel.getByRole("button", { name: "Changer la finition de Prisme spectral — Solaire" }).click();
|
||||
const solarVariation = mythicEditorPanel.getByRole("group", { name: "Prisme spectral — Solaire" });
|
||||
await solarVariation.getByLabel("Palette holographique").click();
|
||||
await solarVariation.getByRole("button", { name: "Aurore", exact: true }).click();
|
||||
await solarVariation.getByRole("button", { name: "Valider la nouvelle finition de Prisme spectral — Solaire" }).click();
|
||||
await solarSettings.getByLabel("Palette holographique").click();
|
||||
await solarSettings.getByRole("button", { name: "Aurore", exact: true }).click();
|
||||
await solarSettings.getByRole("button", { name: "Enregistrer" }).click();
|
||||
await page.getByRole("dialog", { name: "Changer la finition de Prisme spectral — Solaire ?" }).getByRole("button", { name: "Changer la finition" }).click();
|
||||
await expect(dragonVariations.locator("strong")).toHaveText(["Aurore", "Cosmique"]);
|
||||
// Les paliers d'une variation, de 1 à 5 : l'aperçu suit le curseur, l'enregistrement suit quand le réglage se pose.
|
||||
const tunedVariation = mythicEditorPanel.getByRole("group", { name: "Prisme spectral — Aurore" });
|
||||
const tunedCard = tunedVariation.locator('.nebula-card[data-card-size="sm"]');
|
||||
await tunedVariation.getByRole("slider", { name: "Intensité" }).fill("5");
|
||||
await expect(tunedCard).toHaveAttribute("data-holo-intensity", "5");
|
||||
await tunedVariation.getByRole("slider", { name: "Vitesse" }).fill("1");
|
||||
await expect(tunedCard).toHaveAttribute("data-holo-level", "1");
|
||||
// Les paliers d'une variation, de 1 à 5 : l'aperçu suit le curseur, l'enregistrement attend « Enregistrer ».
|
||||
const tunedSettings = mythicEditorPanel.getByRole("region", { name: "Réglages de Prisme spectral — Aurore" });
|
||||
const tunedCard = dragonVariations.first().locator('.nebula-card[data-card-size="sm"]');
|
||||
const tunedEdition = async () => (await page.evaluate(() => globalThis.fetch("/api/cards/config").then((response) => response.json()))).catalog.editions.find((edition) => edition.id === "starvoid-dragon-spectral-prism-aurora");
|
||||
await tunedSettings.getByRole("slider", { name: "Intensité" }).fill("5");
|
||||
await expect(tunedCard).toHaveAttribute("data-holo-intensity", "5");
|
||||
// Le panneau montre la variation en grand, au vrai format `lg`, avec les réglages en cours.
|
||||
const settingsCard = tunedSettings.locator('.nebula-admin-mythic-settings-preview > .nebula-card');
|
||||
await expect(settingsCard).toHaveAttribute("data-card-size", "lg");
|
||||
await expect(settingsCard).toHaveAttribute("data-holo-intensity", "5");
|
||||
const settingsCardBox = await settingsCard.boundingBox();
|
||||
expect([Math.round(settingsCardBox.width), Math.round(settingsCardBox.height)]).toEqual([300, 420]);
|
||||
await tunedSettings.getByRole("slider", { name: "Vitesse" }).fill("1");
|
||||
await expect(tunedCard).toHaveAttribute("data-holo-level", "1");
|
||||
await expect(tunedSettings.locator(".nebula-admin-customizer-summary")).toHaveText("Prisme spectral · Aurore · Standard · Intensité très intense · Vitesse très lente · Particules : aucune");
|
||||
expect((await tunedEdition()).holoIntensity).toBeUndefined();
|
||||
// Passer à une autre variation garde le réglage en cours, signalé sur sa tuile.
|
||||
await dragonVariations.nth(1).getByRole("button", { name: "Régler Prisme spectral — Cosmique" }).click();
|
||||
await expect(tunedCard).toHaveAttribute("data-holo-intensity", "5");
|
||||
await expect(dragonVariations.first()).toContainText("Non enregistrée");
|
||||
await dragonVariations.first().getByRole("button", { name: "Régler Prisme spectral — Aurore" }).click();
|
||||
await tunedSettings.getByRole("button", { name: "Enregistrer" }).click();
|
||||
await expect.poll(async () => { const edition = await tunedEdition(); return [edition.holoIntensity, edition.holoLevel]; }).toEqual([5, 1]);
|
||||
await expect(dragonVariations.first()).not.toHaveAttribute("data-modified");
|
||||
// Retour aux paliers centraux : la variation retrouve son rendu de référence, sans attribut.
|
||||
await tunedVariation.getByRole("slider", { name: "Intensité" }).fill("3");
|
||||
await tunedVariation.getByRole("slider", { name: "Vitesse" }).fill("3");
|
||||
await tunedSettings.getByRole("slider", { name: "Intensité" }).fill("3");
|
||||
await tunedSettings.getByRole("slider", { name: "Vitesse" }).fill("3");
|
||||
await tunedSettings.getByRole("button", { name: "Enregistrer" }).click();
|
||||
await expect.poll(async () => { const edition = await tunedEdition(); return [edition.holoIntensity, edition.holoLevel]; }).toEqual([undefined, undefined]);
|
||||
await expect(tunedCard).not.toHaveAttribute("data-holo-level");
|
||||
await expect(tunedCard).not.toHaveAttribute("data-holo-intensity");
|
||||
|
|
@ -759,8 +797,10 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
const variations = editor.locator(".nebula-admin-mythic-variation");
|
||||
await expect(variations).toHaveCount(1);
|
||||
await expect(variations.first().locator("strong")).toHaveText("Solaire");
|
||||
await expect(variations.first().locator(".nebula-admin-mythic-variation-specs dd")).toHaveText(["Standard", "Prisme spectral", "À venir"]);
|
||||
await expect(editor.getByRole("button", { name: "Enregistrer" })).toHaveCount(0);
|
||||
await expect(variations.first().locator("small")).toHaveText("Prisme spectral");
|
||||
await expect(editor.locator(".nebula-admin-customizer-summary")).toHaveText("Prisme spectral · Solaire · Standard · Intensité normale · Vitesse normale · Particules : aucune");
|
||||
// La variation sélectionnée s'ouvre dans le panneau de réglages : rien à enregistrer tant qu'aucun réglage ne change.
|
||||
await expect(editor.getByRole("button", { name: "Enregistrer" })).toBeDisabled();
|
||||
const cardOpening = editor.getByRole("group", { name: "Ouverture mythique de la carte" });
|
||||
await expectOptions(page, cardOpening, "Forme de particules", ["Étincelles", "Flocons de neige (hérité de la collection)"]);
|
||||
await expect(selectTrigger(cardOpening, "Forme de particules")).toHaveText("Flocons de neige (hérité de la collection)");
|
||||
|
|
@ -769,49 +809,49 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
await page.keyboard.press("Escape");
|
||||
await editor.getByRole("button", { name: "Ajouter une variation" }).click();
|
||||
await expect(variations).toHaveCount(2);
|
||||
await expect(variations.nth(1).getByRole("button", { name: "Palette holographique : Arc-en-ciel" })).toBeVisible();
|
||||
await expect(selectTrigger(variations.nth(1), "Particules")).toBeDisabled();
|
||||
const draftSettings = editor.getByRole("region", { name: "Réglages de la nouvelle variation" });
|
||||
await expect(draftSettings.getByRole("button", { name: "Palette holographique : Arc-en-ciel" })).toBeVisible();
|
||||
await expect(variations.nth(1)).toHaveAttribute("data-selected", "true");
|
||||
await expect(editor.getByRole("button", { name: "Ajouter une variation" })).toHaveCount(0);
|
||||
const draftActions = variations.nth(1).locator(".nebula-admin-mythic-variation-actions .nds-icon-button");
|
||||
await expect(draftActions).toHaveCount(2);
|
||||
await expect(draftActions.first()).toHaveAccessibleName("Valider la nouvelle variation");
|
||||
await expect(draftActions.first()).toHaveAttribute("data-variant", "primary");
|
||||
await expect(draftActions.nth(1)).toHaveAccessibleName("Annuler la nouvelle variation");
|
||||
await variations.nth(1).getByLabel("Palette holographique").click();
|
||||
await variations.nth(1).getByRole("button", { name: "Solaire", exact: true }).click();
|
||||
await expect(variations.nth(1).getByRole("status")).toHaveText("Cette combinaison existe déjà.");
|
||||
await expect(draftActions.first()).toBeDisabled();
|
||||
await draftActions.nth(1).click();
|
||||
const createVariation = draftSettings.getByRole("button", { name: "Créer la variation" });
|
||||
await expect(createVariation).toHaveAttribute("data-variant", "primary");
|
||||
await draftSettings.getByLabel("Palette holographique").click();
|
||||
await draftSettings.getByRole("button", { name: "Solaire", exact: true }).click();
|
||||
await expect(draftSettings.getByRole("status")).toHaveText("Cette combinaison existe déjà.");
|
||||
await expect(createVariation).toBeDisabled();
|
||||
await draftSettings.getByRole("button", { name: "Annuler" }).click();
|
||||
await expect(variations).toHaveCount(1);
|
||||
await editor.getByRole("button", { name: "Ajouter une variation" }).click();
|
||||
await expect(variations).toHaveCount(2);
|
||||
const variationColumns = () => editor.locator(".nebula-admin-mythic-variations").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.trim().split(/\s+/).length);
|
||||
await page.setViewportSize({ width: 2560, height: 1080 });
|
||||
expect(await variationColumns()).toBe(3);
|
||||
const copyBesideCard = async () => {
|
||||
const [cardBox, copyBox] = await Promise.all([variations.first().locator(".nebula-card").boundingBox(), variations.first().locator(".nebula-admin-mythic-variation-copy").boundingBox()]);
|
||||
return copyBox.x >= cardBox.x + cardBox.width - 1;
|
||||
// Les miniatures des variations se suivent sur une ligne ; le panneau de réglages prend toute la largeur en dessous et
|
||||
// place la carte `lg` à gauche de la personnalisation quand il a la place, au-dessus sinon.
|
||||
const stripThenPanel = async () => {
|
||||
const [first, second, settings, block] = await Promise.all([variations.first().boundingBox(), variations.nth(1).boundingBox(), draftSettings.boundingBox(), editor.locator(".nebula-admin-mythic-variations-block").boundingBox()]);
|
||||
return Math.abs(first.y - second.y) <= 1 && second.x > first.x + first.width - 1 && settings.y > first.y + first.height && Math.abs(settings.width - block.width) <= 1;
|
||||
};
|
||||
const cardBesideCustomizer = async () => {
|
||||
const [preview, customizer] = await Promise.all([draftSettings.locator(".nebula-admin-mythic-settings-preview > .nebula-card").boundingBox(), draftSettings.locator(".nebula-admin-customizer").boundingBox()]);
|
||||
return customizer.x >= preview.x + preview.width - 1;
|
||||
};
|
||||
expect(await copyBesideCard()).toBe(true);
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
expect(await variationColumns()).toBe(3);
|
||||
expect(await copyBesideCard()).toBe(false);
|
||||
expect(await stripThenPanel()).toBe(true);
|
||||
expect(await cardBesideCustomizer()).toBe(true);
|
||||
await page.setViewportSize({ width: 768, height: 720 });
|
||||
expect(await variationColumns()).toBe(3);
|
||||
// En demi-écran comme en grand, le menu de palette de la dernière colonne se recale au lieu d'être coupé.
|
||||
expect(await stripThenPanel()).toBe(true);
|
||||
expect(await cardBesideCustomizer()).toBe(false);
|
||||
// En demi-écran comme en grand, le menu de palette se recale au lieu d'être coupé.
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
await variations.nth(1).scrollIntoViewIfNeeded();
|
||||
await variations.nth(1).getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
await draftSettings.scrollIntoViewIfNeeded();
|
||||
await draftSettings.getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
await expectOpenMenuVisible(page, ".nebula-admin-palette-menu.is-open");
|
||||
await page.keyboard.press("Escape");
|
||||
await page.evaluate(() => globalThis.scrollTo(0, globalThis.document.documentElement.scrollHeight));
|
||||
await variations.nth(1).getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
await draftSettings.getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
await expectOpenMenuVisible(page, ".nebula-admin-palette-menu.is-open");
|
||||
await page.keyboard.press("Escape");
|
||||
await page.setViewportSize({ width: 768, height: 720 });
|
||||
await variations.nth(1).getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
const lastPaletteOption = variations.nth(1).getByRole("button", { name: "Ténèbres", exact: true });
|
||||
await draftSettings.getByRole("button", { name: "Palette holographique : Arc-en-ciel" }).click();
|
||||
const lastPaletteOption = draftSettings.getByRole("button", { name: "Ténèbres", exact: true });
|
||||
await expect(lastPaletteOption).toBeVisible();
|
||||
await lastPaletteOption.scrollIntoViewIfNeeded();
|
||||
// L'événement de défilement part à la frame suivante : le menu doit rester défilé après son traitement.
|
||||
|
|
@ -831,9 +871,9 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
await expect(editorSurface).toHaveCSS("--opening-aura", "#ff0000");
|
||||
// Les paliers se règlent dès la création : ils s'enregistrent avec la nouvelle variation.
|
||||
const draftVariation = editor.locator(".nebula-admin-mythic-variation[data-new]");
|
||||
await draftVariation.getByRole("slider", { name: "Intensité" }).fill("4");
|
||||
await draftSettings.getByRole("slider", { name: "Intensité" }).fill("4");
|
||||
await expect(draftVariation.locator('.nebula-card[data-card-size="sm"]')).toHaveAttribute("data-holo-intensity", "4");
|
||||
await editor.getByRole("button", { name: "Valider la nouvelle variation" }).click();
|
||||
await createVariation.click();
|
||||
await expect(editor.locator(".nebula-admin-mythic-variation[data-new]")).toHaveCount(0);
|
||||
await expect(editor.locator(".nebula-admin-mythic-variation")).toHaveCount(2);
|
||||
await expect(editor.locator(".nebula-admin-mythic-variation strong")).toHaveText(["Arc-en-ciel", "Solaire"]);
|
||||
|
|
@ -887,16 +927,26 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
expect(Math.round(mythicBox.width)).toBe(760);
|
||||
expect(Math.abs((mythicBox.x - gridBox.x) - (gridBox.x + gridBox.width - mythicBox.x - mythicBox.width))).toBeLessThanOrEqual(1);
|
||||
|
||||
const effectStyles = page.locator(".nebula-admin-effect-grid .nebula-admin-style-card");
|
||||
await expect(effectStyles.locator("h4")).toHaveText(["Prisme spectral", "Reflet diffractif", "Parallaxe prismatique", "Glace brisée"]);
|
||||
const iceCard = effectStyles.filter({ has: page.getByRole("heading", { name: /Glace brisée/ }) }).locator('.nebula-card[data-holo-effect="shattered-ice"]');
|
||||
// Un seul banc d'essai : une miniature par effet pour le choisir, puis l'aperçu `lg` et le panneau à onglets Holo / Particules.
|
||||
const bench = page.locator(".nebula-admin-lab-bench");
|
||||
const labCard = bench.locator(".nebula-admin-style-preview > .nebula-card");
|
||||
const tryEffect = (label) => bench.getByRole("button", { name: `Essayer ${label}` }).click();
|
||||
await expect(bench.locator(".nebula-admin-lab-effect > span")).toHaveText(["Prisme spectral", "Reflet diffractif", "Parallaxe prismatique", "Glace brisée"]);
|
||||
await expect(bench.locator('.nebula-admin-lab-effect .nebula-card[data-card-size="sm"]')).toHaveCount(4);
|
||||
await expect(bench.getByRole("button", { name: "Essayer Prisme spectral" })).toHaveAttribute("aria-pressed", "true");
|
||||
await expect(bench.getByRole("tab")).toHaveText(["Holo", "Particules"]);
|
||||
await tryEffect("Glace brisée");
|
||||
await expect(bench.getByRole("heading", { name: "Glace brisée", exact: true })).toBeVisible();
|
||||
await expect(bench.getByRole("button", { name: "Essayer Glace brisée" })).toHaveAttribute("aria-pressed", "true");
|
||||
const iceCard = bench.locator('.nebula-admin-style-preview > .nebula-card[data-holo-effect="shattered-ice"]');
|
||||
await expect(iceCard.locator(".nebula-card-holo-shards > i")).toHaveCount(4);
|
||||
await expect(iceCard.locator('.nebula-card-holo-shards > [data-facet="0"]')).toHaveCSS("mask-image", /shattered-ice-facet-0\.webp/);
|
||||
// En format standard, la glace passe sous l'illustration, qui reste intacte.
|
||||
expect(await iceCard.evaluate((element) => { const view = element.ownerDocument.defaultView; return Number(view.getComputedStyle(element.querySelector(".nebula-card-art")).zIndex) > Number(view.getComputedStyle(element.querySelector(".nebula-card-holo-shards")).zIndex); })).toBe(true);
|
||||
await expect(bench.getByRole("slider", { name: "Taille des éclats" })).toBeVisible();
|
||||
// La Parallaxe prismatique pose le héros détouré de la carte sur son décor sans lui, puis les décale selon leur profondeur.
|
||||
const parallaxStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Parallaxe prismatique", exact: true }) });
|
||||
const parallaxCard = parallaxStyle.locator('.nebula-card[data-holo-effect="prismatic-backdrop"]');
|
||||
await tryEffect("Parallaxe prismatique");
|
||||
const parallaxCard = bench.locator('.nebula-admin-style-preview > .nebula-card[data-holo-effect="prismatic-backdrop"]');
|
||||
await expect(parallaxCard.locator(".nebula-card-art")).toHaveAttribute("data-parallax-setup", "clean");
|
||||
await expect(parallaxCard.locator(".nebula-card-depth-layer")).toHaveCount(2);
|
||||
await expect(parallaxCard.locator('[data-depth-layer="backdrop"] img[src$="/mythic_card_pull__backdrop.webp"]')).toBeVisible();
|
||||
|
|
@ -911,29 +961,35 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
await expect.poll(() => layerShiftX("backdrop")).toBeLessThan(-3);
|
||||
expect(await layerShiftX("subject")).toBeGreaterThan(0);
|
||||
await page.mouse.move(0, 0);
|
||||
await chooseOption(parallaxStyle, "Format", "Pleine illustration");
|
||||
await chooseOption(bench, "Format", "Pleine illustration");
|
||||
await expect(parallaxCard.locator('[data-depth-layer="backdrop"] img[src$="/mythic_card_pull__full__backdrop.webp"]')).toBeVisible();
|
||||
await expect(parallaxCard.locator('[data-depth-layer="subject"] img[src$="/mythic_card_pull__full__cutout.webp"]')).toBeVisible();
|
||||
await chooseOption(parallaxStyle, "Format", "Standard");
|
||||
await chooseOption(bench, "Format", "Standard");
|
||||
// Les paliers, de 1 à 5, s'essaient sur l'aperçu : intensité de la palette pour tous les effets, amplitude pour la parallaxe.
|
||||
const parallaxIntensity = parallaxStyle.getByRole("slider", { name: "Intensité" });
|
||||
await expect(parallaxIntensity).toHaveValue("3");
|
||||
const labIntensity = bench.getByRole("slider", { name: "Intensité" });
|
||||
await expect(labIntensity).toHaveValue("3");
|
||||
await expect(parallaxCard).not.toHaveAttribute("data-holo-intensity");
|
||||
await parallaxIntensity.fill("5");
|
||||
await labIntensity.fill("5");
|
||||
await expect(parallaxCard).toHaveAttribute("data-holo-intensity", "5");
|
||||
await expect(parallaxStyle.locator(".nebula-admin-tuning-range").first()).toContainText("Très intense");
|
||||
await parallaxStyle.getByRole("slider", { name: "Amplitude" }).fill("1");
|
||||
await expect(bench.locator(".nebula-admin-tuning-range").first()).toContainText("Très intense");
|
||||
await bench.getByRole("slider", { name: "Amplitude" }).fill("1");
|
||||
await expect(parallaxCard).toHaveAttribute("data-holo-level", "1");
|
||||
// Le Reflet diffractif n'a que l'intensité ; la Glace brisée règle la taille de ses éclats.
|
||||
await expect(effectStyles.filter({ has: page.getByRole("heading", { name: "Reflet diffractif", exact: true }) }).getByRole("slider")).toHaveCount(1);
|
||||
await expect(effectStyles.filter({ has: page.getByRole("heading", { name: "Glace brisée", exact: true }) }).getByRole("slider", { name: "Taille des éclats" })).toBeVisible();
|
||||
const spectralStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Prisme spectral", exact: true }) });
|
||||
// Les miniatures suivent les mêmes réglages pour comparer les effets à réglages égaux ; le résumé les reprend.
|
||||
await expect(bench.locator('.nebula-admin-lab-effect .nebula-card[data-holo-effect="spectral-prism"]')).toHaveAttribute("data-holo-intensity", "5");
|
||||
await expect(bench.locator(".nebula-admin-customizer-summary")).toHaveText("Parallaxe prismatique · Arc-en-ciel · Standard · Intensité très intense · Amplitude très douce · Particules : aucune");
|
||||
await labIntensity.fill("3");
|
||||
await bench.getByRole("slider", { name: "Amplitude" }).fill("3");
|
||||
await expect(parallaxCard).not.toHaveAttribute("data-holo-level");
|
||||
// Le Reflet diffractif n'a que l'intensité.
|
||||
await tryEffect("Reflet diffractif");
|
||||
await expect(bench.getByRole("slider")).toHaveCount(1);
|
||||
await tryEffect("Prisme spectral");
|
||||
// Les aperçus holographiques gardent le vrai format `lg`, 300 x 420 px.
|
||||
const holoPreviewBox = await spectralStyle.locator(".nebula-admin-style-preview > .nebula-card").boundingBox();
|
||||
const holoPreviewBox = await labCard.boundingBox();
|
||||
expect([Math.round(holoPreviewBox.width), Math.round(holoPreviewBox.height)]).toEqual([300, 420]);
|
||||
// Pleine illustration : l'image remplit la carte, la description disparaît et le nom reste, avec son effet métallique.
|
||||
await chooseOption(spectralStyle, "Format", "Pleine illustration");
|
||||
const fullArtCard = spectralStyle.locator('.nebula-card[data-card-layout="full-art"][data-holo-effect="spectral-prism"]');
|
||||
await chooseOption(bench, "Format", "Pleine illustration");
|
||||
const fullArtCard = bench.locator('.nebula-admin-style-preview > .nebula-card[data-card-layout="full-art"][data-holo-effect="spectral-prism"]');
|
||||
await expect(fullArtCard.locator('.nebula-card-art img[src$="/astral-genesis/legendary/mythic_card_pull__full.webp"]')).toBeVisible();
|
||||
await expect(fullArtCard.locator(".nebula-card-copy")).toHaveCount(0);
|
||||
await expect(fullArtCard.locator("h3")).toBeVisible();
|
||||
|
|
@ -947,37 +1003,36 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
});
|
||||
expect(fullArtBounds.widthGap).toBeLessThanOrEqual(5);
|
||||
expect(fullArtBounds.heightGap).toBeLessThanOrEqual(5);
|
||||
await chooseOption(spectralStyle, "Format", "Standard");
|
||||
await expect(spectralStyle).toHaveCount(1);
|
||||
await expect(spectralStyle.locator('.nebula-card[data-card-size="lg"]')).toHaveCount(1);
|
||||
await expect(spectralStyle.locator('.nebula-card-art img[src$="/astral-genesis/legendary/mythic_card_pull.webp"]')).toHaveCount(1);
|
||||
await expect(spectralStyle.getByRole("heading", { name: "Prisme spectral", exact: true })).toBeVisible();
|
||||
await expect(selectTrigger(spectralStyle, "Particules au survol")).toBeDisabled();
|
||||
await expect(selectTrigger(spectralStyle, "Particules au survol")).toHaveText("À venir");
|
||||
const paletteTrigger = spectralStyle.getByRole("button", { name: "Palette de couleurs : Arc-en-ciel" });
|
||||
await chooseOption(bench, "Format", "Standard");
|
||||
await expect(labCard.locator('.nebula-card-art img[src$="/astral-genesis/legendary/mythic_card_pull.webp"]')).toHaveCount(1);
|
||||
await expect(bench.getByRole("heading", { name: "Prisme spectral", exact: true })).toBeVisible();
|
||||
// L'onglet Particules ne propose encore aucune animation.
|
||||
await bench.getByRole("tab", { name: "Particules" }).click();
|
||||
await expect(bench.getByRole("tab", { name: "Particules" })).toHaveAttribute("aria-selected", "true");
|
||||
await expect(selectTrigger(bench, "Animation")).toBeDisabled();
|
||||
await expect(selectTrigger(bench, "Animation")).toHaveText("Aucune");
|
||||
await bench.getByRole("tab", { name: "Holo" }).click();
|
||||
const paletteTrigger = bench.getByRole("button", { name: "Palette holographique : Arc-en-ciel" });
|
||||
const paletteTriggerLabel = paletteTrigger.getByText("Arc-en-ciel", { exact: true });
|
||||
await expect(paletteTriggerLabel).toBeVisible();
|
||||
expect(await paletteTriggerLabel.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||
await expect(paletteTrigger.locator('.nebula-admin-palette[data-compact="true"] i').first()).toHaveCSS("width", "12px");
|
||||
await expect(paletteTrigger.locator('.nebula-admin-palette[data-compact="true"] i').first()).toHaveCSS("width", "10px");
|
||||
await paletteTrigger.click();
|
||||
await expect(spectralStyle).toHaveCSS("overflow", "visible");
|
||||
const solarPaletteOption = spectralStyle.getByRole("button", { name: "Solaire", exact: true });
|
||||
await expect(bench).toHaveCSS("overflow", "visible");
|
||||
const solarPaletteOption = bench.getByRole("button", { name: "Solaire", exact: true });
|
||||
await expect(solarPaletteOption.locator('.nebula-admin-palette[data-compact="true"] i')).toHaveCount(7);
|
||||
await solarPaletteOption.click();
|
||||
await expect(spectralStyle.getByRole("button", { name: "Palette de couleurs : Solaire" })).toBeVisible();
|
||||
await expect(spectralStyle.locator('.nebula-card[data-holo-palette="solar"], .nebula-card-face[data-holo-palette="solar"]').first()).toBeVisible();
|
||||
await expect(bench.getByRole("button", { name: "Palette holographique : Solaire" })).toBeVisible();
|
||||
await expect(labCard).toHaveAttribute("data-holo-palette", "solar");
|
||||
|
||||
// Reflet diffractif : mêmes réglages que le prisme, mais tout découle du tilt, sans animation automatique.
|
||||
const diffractionStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Reflet diffractif", exact: true }) });
|
||||
const diffractionCard = diffractionStyle.locator(".nebula-admin-style-preview > .nebula-card");
|
||||
// Reflet diffractif : la palette choisie reste quand on change d'effet ; tout découle du tilt, sans animation automatique.
|
||||
await tryEffect("Reflet diffractif");
|
||||
const diffractionCard = labCard;
|
||||
const diffractionLayer = diffractionCard.locator(".nebula-card-holo-primary");
|
||||
await chooseOption(diffractionStyle, "Format", "Pleine illustration");
|
||||
await chooseOption(bench, "Format", "Pleine illustration");
|
||||
await expect(diffractionCard).toHaveAttribute("data-card-layout", "full-art");
|
||||
await chooseOption(diffractionStyle, "Format", "Standard");
|
||||
await diffractionStyle.getByRole("button", { name: "Palette de couleurs : Arc-en-ciel" }).click();
|
||||
await diffractionStyle.getByRole("button", { name: "Solaire", exact: true }).click();
|
||||
await chooseOption(bench, "Format", "Standard");
|
||||
await expect(diffractionCard).toHaveAttribute("data-holo-palette", "solar");
|
||||
await expect(selectTrigger(diffractionStyle, "Particules au survol")).toHaveText("À venir");
|
||||
await diffractionCard.scrollIntoViewIfNeeded();
|
||||
await expect(diffractionLayer).toHaveCSS("opacity", "0.05");
|
||||
const diffractionBox = await diffractionCard.boundingBox();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue