mirror of
https://github.com/block/buzz.git
synced 2026-11-29 12:42:49 +00:00
fix(desktop): refine focused thread dismissal targets (#2644)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
requestFocusedThreadClose,
|
||||
subscribeToFocusedThreadCloseRequest,
|
||||
} from "./focusedThreadCloseRequest.ts";
|
||||
|
||||
test("focus thread close requests reach active subscribers only", () => {
|
||||
let calls = 0;
|
||||
const unsubscribe = subscribeToFocusedThreadCloseRequest(() => {
|
||||
calls += 1;
|
||||
});
|
||||
|
||||
requestFocusedThreadClose();
|
||||
assert.equal(calls, 1);
|
||||
|
||||
unsubscribe();
|
||||
requestFocusedThreadClose();
|
||||
assert.equal(calls, 1);
|
||||
});
|
||||
Reference in New Issue
Block a user