feat(sdk,plugins): typage et stabilisation runtime UI/layout publique (#128)

This commit is contained in:
2026-08-02 13:36:17 +02:00
parent e3e887d6a4
commit 8c4f1ea2e3
9 changed files with 1090 additions and 20 deletions

View File

@ -30,7 +30,10 @@ function cell(overrides: Partial<CustomPluginLayoutCell> = {}): CustomPluginLayo
};
}
let latestLayoutProps: PluginLayoutProps | null = null;
function MockLayoutComponent(props: PluginLayoutProps) {
latestLayoutProps = props;
return (
<div>
<p data-testid="state">{JSON.stringify(props.state)}</p>
@ -87,8 +90,11 @@ describe("PluginLayoutCellView", () => {
it("renders the mock registered component when the provider is loaded", () => {
const registry = new PluginRuntimeRegistry();
registry.add(stubPlugin());
latestLayoutProps = null;
renderCell(registry);
expect(screen.getByTestId("state").textContent).toBe(JSON.stringify({ commits: 3 }));
expect(latestLayoutProps).not.toBeNull();
expect(Object.prototype.hasOwnProperty.call(latestLayoutProps, "gateways")).toBe(false);
});
it("round-trips state through setState → onStateChange", () => {