Files
rayd1o 05377bf5c6
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / delivery (push) Has been cancelled
release / images (push) Has been cancelled
release: bump version to 0.76.0
2026-09-30 17:49:29 +08:00

11 lines
658 B
JavaScript

import {expect,test} from "bun:test";
import {createCalloutGroups} from "./spatial-callouts.js";
test("news and compute reserve positions in one solver, removing one scope preserves the other",()=>{
let current=[],destroyed=false;
const registry=createCalloutGroups({set:items=>{current=items;},invalidate(){},update(){},destroy(){destroyed=true;}});
const compute=registry.scope("compute"),news=registry.scope("news");
compute.set([{key:"CN"}]);news.set([{key:"news:europe"}]);
expect(current.map(item=>item.key)).toEqual(["CN","news:europe"]);
news.destroy();expect(current).toEqual([{key:"CN"}]);registry.destroy();expect(destroyed).toBe(true);
});