Strengthen shell behavior tests and profile toolbox loading
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s

This commit is contained in:
Shinuwa 2026-09-12 13:15:42 +02:00
parent a9b68a5712
commit b53c7c17c8
8 changed files with 323 additions and 61 deletions

View file

@ -0,0 +1,21 @@
// Rôle : monte les vrais overlays et textes éditoriaux sous StrictMode pour tester leur cycle de vie.
import { createElement, StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { flushSync } from "react-dom";
import { ConfirmModal, CreateToolboxModal, NotificationToast } from "../../website/src/components/ToolboxModals.jsx";
import { RichText } from "../../website/src/components/RichText.jsx";
export function mountShellProbe(element) {
const root = createRoot(element);
const closed = [];
const onClose = (value) => closed.push(value);
function render({ confirm = false, create = false, toast = null, text = "" } = {}) {
flushSync(() => root.render(createElement(StrictMode, null,
confirm && createElement(ConfirmModal, { key: "confirm", title: "Confirmation test", message: "Continuer ?", onClose }),
create && createElement(CreateToolboxModal, { key: "create", onClose }),
toast && createElement(NotificationToast, { key: "toast", ...toast, onClose }),
createElement("div", { id: "editorial-text", key: "text" }, createElement(RichText, { text }))
)));
}
return { render, closed, unmount: () => root.unmount() };
}