Add ui/notifications/request-teardown notification for view-initiated termination (#215)

* Add ui/close-resource request for UI to initiate termination

* Add missing METHOD export

* Fix typo in remaining ui/request-close

* Align spec terminology to teardown/termination instead of close/clearnup

* Implement final comments

* Removing view behavior on initiation of request termination
This commit is contained in:
Frédéric Barthelet 2026-03-19 21:01:59 +01:00 • committed by GitHub
commit c026b398a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -520,6 +520,31 @@ describe("App <-> AppBridge integration", () => {
}),
).rejects.toThrow("Context update failed");
});
it("app.requestTeardown allows host to initiate teardown flow", async () => {
const events: string[] = [];
bridge.onrequestteardown = async () => {
events.push("teardown-requested");
await bridge.teardownResource({});
events.push("teardown-complete");
};
app.onteardown = async () => {
events.push("persist-unsaved-state");
return {};
};
await app.connect(appTransport);
await app.requestTeardown();
await flush();
expect(events).toEqual([
"teardown-requested",
"persist-unsaved-state",
"teardown-complete",
]);
});
});
describe("App -> Host requests", () => {