feat(sdk,plugins): typage et stabilisation runtime UI/layout publique (#128)
This commit is contained in:
@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user