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:
parent
296b5921fb
commit
c026b398a1
1 changed files with 195 additions and 5 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue